View | Details | Raw Unified | Return to bug 8131
Collapse All | Expand All

(-)xxkb-1.10.orig/README.koi8 (-4 / +4 lines)
Lines 91-100 Link Here
91
ÓÉÌØÎÏ ÚÁ×ÉÓÉÔ ÏÔ ÔÉÐÁ WM.
91
ÓÉÌØÎÏ ÚÁ×ÉÓÉÔ ÏÔ ÔÉÐÁ WM.
92
92
93
XXkb.mainwindow.in_tray - ÓÏÏÂÝÁÅÔ GNOME ÉÌÉ KDE, ÞÔÏ xxkb ÄÏÌÖÅÎ ×ÓÔÒÁÉ×ÁÔØÓÑ
93
XXkb.mainwindow.in_tray - ÓÏÏÂÝÁÅÔ GNOME ÉÌÉ KDE, ÞÔÏ xxkb ÄÏÌÖÅÎ ×ÓÔÒÁÉ×ÁÔØÓÑ
94
× tray. úÎÁÞÅÎÉÅ ÏÐÃÉÉ GNOME, KDE ÉÌÉ KDE2, × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÔÏÇÏ, × ÞÅÊ tray
94
× tray. úÎÁÞÅÎÉÅ ÏÐÃÉÉ GNOME, GNOME2, KDE ÉÌÉ KDE2, × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÔÏÇÏ, ×
95
ÎÁÄÏ ÐÏÍÅÓÔÉÔØ xxkb. (ë ÓÏÖÁÌÅÎÉÀ, ÔÁËÉÅ docklet'Ù ÉÍÅÀÔ ÒÁÚÍÅÒ ÍÅÎØÛÅ, ÞÅÍ
95
ÞÅÊ tray ÎÁÄÏ ÐÏÍÅÓÔÉÔØ xxkb. (ë ÓÏÖÁÌÅÎÉÀ, ÔÁËÉÅ docklet'Ù ÉÍÅÀÔ ÒÁÚÍÅÒ
96
ÒÁÚÍÅÒÙ ÉËÏÎÏË ÄÌÑ ÇÌÁ×ÎÏÇÏ ÏËÎÁ × ÄÉÓÔÒÉÂÕÔÉ×Å xxkb. åÓÌÉ ÈÏÔÉÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ
96
ÍÅÎØÛÅ, ÞÅÍ ÒÁÚÍÅÒÙ ÉËÏÎÏË ÄÌÑ ÇÌÁ×ÎÏÇÏ ÏËÎÁ × ÄÉÓÔÒÉÂÕÔÉ×Å xxkb. åÓÌÉ ÈÏÔÉÔÅ
97
ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ, ÐÏÄÂÅÒÉÔÅ ÐÏÄÈÏÄÑÝÉÅ ÉËÏÎËÉ).
97
ÉÓÐÏÌØÚÏ×ÁÔØ ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ, ÐÏÄÂÅÒÉÔÅ ÐÏÄÈÏÄÑÝÉÅ ÉËÏÎËÉ).
98
98
99
XXkb.mainwindow.geometry - ÒÁÚÍÅÒ ÇÌÁ×ÎÏÇÏ ÏËÎÁ  - "ÛÉÒÉÎÁ"x"×ÙÓÏÔÁ"
99
XXkb.mainwindow.geometry - ÒÁÚÍÅÒ ÇÌÁ×ÎÏÇÏ ÏËÎÁ  - "ÛÉÒÉÎÁ"x"×ÙÓÏÔÁ"
100
(ÖÅÌÁÔÅÌØÎÏ, ÞÔÏÂÙ ÏÎÉ ÓÏÏÔ×ÅÔÓÔ×Ï×ÁÌÉ ÒÁÚÍÅÒÕ "ËÁÒÔÉÎÏË" ÄÌÑ ÇÌÁ×ÎÏÇÏ ÏËÎÁ)
100
(ÖÅÌÁÔÅÌØÎÏ, ÞÔÏÂÙ ÏÎÉ ÓÏÏÔ×ÅÔÓÔ×Ï×ÁÌÉ ÒÁÚÍÅÒÕ "ËÁÒÔÉÎÏË" ÄÌÑ ÇÌÁ×ÎÏÇÏ ÏËÎÁ)
(-)xxkb-1.10.orig/XXkb.ad (-1 / +1 lines)
Lines 13-19 Link Here
13
XXkb.mainwindow.xpm.4:
13
XXkb.mainwindow.xpm.4:
14
14
15
! XXkb.mainwindow.in_tray:
15
! XXkb.mainwindow.in_tray:
16
! possible values - KDE, KDE2, GNOME
16
! possible values - KDE, KDE2, GNOME, GNOME2
17
17
18
XXkb.button.enable: yes
18
XXkb.button.enable: yes
19
XXkb.button.geometry: 15x15-60+7
19
XXkb.button.geometry: 15x15-60+7
(-)xxkb-1.10.orig/xxkb.c (-8 / +88 lines)
Lines 1-6 Link Here
1
/* xxkb  - XKB keyboard indicator/switcher */
1
/* xxkb  - XKB keyboard indicator/switcher */
2
/* (c)  1999 - 2003 Ivan Pascal <pascal@tsu.ru>   */
2
/* (c)  1999 - 2003 Ivan Pascal <pascal@tsu.ru>   */
3
3
4
#include <stdio.h>
5
#include <stdlib.h>
4
#include <X11/Xlib.h>
6
#include <X11/Xlib.h>
5
#include <X11/Xutil.h>
7
#include <X11/Xutil.h>
6
#include <X11/XKBlib.h>
8
#include <X11/XKBlib.h>
Lines 35-43 Link Here
35
WInfo def_info, *info, *tmp_info;
37
WInfo def_info, *info, *tmp_info;
36
kbdState def_state;
38
kbdState def_state;
37
XFocusChangeEvent focused_event;
39
XFocusChangeEvent focused_event;
40
41
struct {
42
  Bool enable;
43
  Atom tray_atom;
44
  Atom opcode_atom;
45
  Atom manager_atom;
46
  Window manager;
47
} gnome2_tray;
48
38
XErrorHandler DefErrHandler;
49
XErrorHandler DefErrHandler;
50
static Bool trap_errors = False;
51
static int trapped_error_code = 0;
39
52
40
static ListAction  FindAppList(Window w);
53
static ListAction  FindAppList(Window w);
54
static void Gnome2TrayUpdateManager();
41
55
42
int main (int argc, char ** argv)
56
int main (int argc, char ** argv)
43
{
57
{
Lines 148-153 Link Here
148
  }
162
  }
149
  else icon = (Window) 0;
163
  else icon = (Window) 0;
150
164
165
  gnome2_tray.enable = False;
166
151
    if (conf.tray_type) {
167
    if (conf.tray_type) {
152
       Atom r;
168
       Atom r;
153
       int data = 1;
169
       int data = 1;
Lines 161-178 Link Here
161
           r = XInternAtom(dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);
177
           r = XInternAtom(dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);
162
           XChangeProperty(dpy, MainWin, r, XA_WINDOW, 32, 0,
178
           XChangeProperty(dpy, MainWin, r, XA_WINDOW, 32, 0,
163
                           (unsigned char *)&data, 1);
179
                           (unsigned char *)&data, 1);
180
       } else if (! strcmp(conf.tray_type, "GNOME2")) {
181
	  char tmp[64];
182
183
	  size_hints = XAllocSizeHints();
184
	  size_hints->width = size_hints->min_width = geom.width;
185
	  size_hints->height = size_hints->min_height = geom.height;
186
	  size_hints->flags = PSize | PMinSize;
187
	  XSetWMNormalHints(dpy, MainWin, size_hints);
188
189
	  gnome2_tray.enable = True;
190
	  sprintf(tmp, "_NET_SYSTEM_TRAY_S%d", scr);
191
	  gnome2_tray.tray_atom = XInternAtom(dpy, tmp, False);
192
	  gnome2_tray.opcode_atom = XInternAtom(dpy,
193
	      "_NET_SYSTEM_TRAY_OPCODE", False);
194
	  gnome2_tray.manager_atom = XInternAtom(dpy, "MANAGER", False);
164
       }
195
       }
165
    }
196
    }
197
  
166
198
167
199
168
  
200
  if (conf.controls&Main_enable && ! gnome2_tray.enable)
169
  if (conf.controls&Main_enable) XMapWindow(dpy, MainWin);
201
    XMapWindow(dpy, MainWin);
170
202
171
/* What events we want */
203
/* What events we want */
172
  XkbSelectEventDetails(dpy, XkbUseCoreKbd, XkbStateNotify,
204
  XkbSelectEventDetails(dpy, XkbUseCoreKbd, XkbStateNotify,
173
                        XkbAllStateComponentsMask, XkbGroupStateMask);
205
                        XkbAllStateComponentsMask, XkbGroupStateMask);
174
  if (conf.controls&When_create)
206
  XSelectInput(dpy, root,
175
    XSelectInput(dpy, root, SubstructureNotifyMask);
207
      ((conf.controls&When_create) ? SubstructureNotifyMask : NoEventMask) |
208
      ((gnome2_tray.enable) ? StructureNotifyMask : NoEventMask));
176
209
177
  XSelectInput(dpy, MainWin, ExposureMask | ButtonPressMask);
210
  XSelectInput(dpy, MainWin, ExposureMask | ButtonPressMask);
178
  if (icon) XSelectInput(dpy, icon, ExposureMask | ButtonPressMask);
211
  if (icon) XSelectInput(dpy, icon, ExposureMask | ButtonPressMask);
Lines 205-210 Link Here
205
    if (!info) info = &def_info;
238
    if (!info) info = &def_info;
206
  }
239
  }
207
240
241
  if (gnome2_tray.enable) Gnome2TrayUpdateManager();
242
208
/* Main Loop */
243
/* Main Loop */
209
  while (1) {
244
  while (1) {
210
    XNextEvent(dpy, &ev.core);
245
    XNextEvent(dpy, &ev.core);
Lines 391-396 Link Here
391
          if(((win == MainWin) || (win == icon))
426
          if(((win == MainWin) || (win == icon))
392
             && ev.core.xclient.data.l[0] == wm_del_win)
427
             && ev.core.xclient.data.l[0] == wm_del_win)
393
             Terminate();
428
             Terminate();
429
	  else if (gnome2_tray.enable &&
430
		  ev.core.xclient.message_type == gnome2_tray.manager_atom &&
431
		  ev.core.xclient.data.l[1] == gnome2_tray.tray_atom)
432
	    Gnome2TrayUpdateManager();
394
          break;
433
          break;
395
        case CreateNotify:
434
        case CreateNotify:
396
        case UnmapNotify:
435
        case UnmapNotify:
Lines 758-766 Link Here
758
   }
797
   }
759
}
798
}
760
799
761
void ErrHandler(Display *dpy, XErrorEvent* err)
800
static void Gnome2TrayUpdateManager()
762
{
801
{
763
  if((err->error_code == BadWindow) || (err->error_code == BadDrawable))
802
  gnome2_tray.manager = XGetSelectionOwner(dpy,
764
     return;
803
      gnome2_tray.tray_atom);
765
  (*DefErrHandler)(dpy, err);
804
805
  if (gnome2_tray.manager)
806
  {
807
    XClientMessageEvent xev;
808
    memset(&xev, 0, sizeof(xev));
809
    xev.type = ClientMessage;
810
    xev.window = gnome2_tray.manager;
811
    xev.message_type = gnome2_tray.opcode_atom;
812
    xev.format = 32;
813
    xev.data.l[0] = CurrentTime;
814
    xev.data.l[1] = 0; /* SYSTEM_TRAY_REQUEST_DOCK */
815
    xev.data.l[2] = MainWin;
816
817
    TrapErrors();
818
    XSendEvent(dpy, gnome2_tray.manager, False, NoEventMask,
819
	(XEvent *) &xev);
820
    UntrapErrors();
821
  }
822
}
823
824
void TrapErrors()
825
{
826
  trapped_error_code = 0;
827
  trap_errors = True;
828
}
829
830
int UntrapErrors()
831
{
832
  trap_errors = False;
833
  return trapped_error_code;
834
}
835
836
int ErrHandler(Display *dpy, XErrorEvent* err)
837
{
838
  if (! trap_errors) {
839
    if((err->error_code == BadWindow) || (err->error_code == BadDrawable))
840
       return 0;
841
    (*DefErrHandler)(dpy, err);
842
  } else {
843
    trapped_error_code = err->error_code;
844
    return 0;
845
  }
766
}
846
}
(-)xxkb-1.10.orig/xxkb.h (-1 / +3 lines)
Lines 66-72 Link Here
66
void Terminate(void);
66
void Terminate(void);
67
67
68
Bool ExpectInput(Window win);
68
Bool ExpectInput(Window win);
69
void ErrHandler(Display* dpy, XErrorEvent* err);
69
int ErrHandler(Display* dpy, XErrorEvent* err);
70
void TrapErrors();
71
int UntrapErrors();
70
72
71
WInfo* AddWindow(Window w, Window parent);
73
WInfo* AddWindow(Window w, Window parent);
72
void   GetAppWindow(Window w, Window* app);
74
void   GetAppWindow(Window w, Window* app);
(-)xxkb-1.10.orig/xxkb.man (-3 / +4 lines)
Lines 77-85 Link Here
77
.TP 4
77
.TP 4
78
.B XXkb.mainwindow.in_tray
78
.B XXkb.mainwindow.in_tray
79
allow to dock \fBxxkb\fR into a system tray. A value of the option should be
79
allow to dock \fBxxkb\fR into a system tray. A value of the option should be
80
GNOME, KDE or KDE2 in depend on what environment tray you use. (Unfortunately,
80
GNOME, GNOME2, KDE or KDE2 in depend on what environment tray you use.
81
such docklets have a size less than a default icons size for an xxkb main
81
(Unfortunately, such docklets have a size less than a default icons size for
82
window. If you want to use this option you need another set of icons.)
82
an xxkb main window. If you want to use this option you need another set of
83
icons.)
83
.TP 4
84
.TP 4
84
.B XXkb.mainwindow.geometry
85
.B XXkb.mainwindow.geometry
85
the geometry ( WIDTHxHEIGHT{+-}X{+-}Y ) of the main window.
86
the geometry ( WIDTHxHEIGHT{+-}X{+-}Y ) of the main window.

Return to bug 8131