From: <enl...@li...> - 2003-03-24 03:48:11
|
Enlightenment CVS committal Author : mej Project : e16 Module : e Dir : e16/e/src Modified Files: E.h Makefile.am actions.c areas.c arrange.c borders.c comms.c config.c desktops.c evhandlers.c focus.c gnome.c iconify.c ipc.c main.c session.c settings.c setup.c size.c sticky.c Added Files: ewmh.c hints.c Log Message: Sun Mar 23 22:45:31 EST 2003 (KainX) Patch from Kim Woelders <ki...@wo...> for freedesktop.org WM hints. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.104 retrieving revision 1.105 diff -u -3 -r1.104 -r1.105 --- E.h 4 Jun 2002 15:49:34 -0000 1.104 +++ E.h 24 Mar 2003 03:48:07 -0000 1.105 @@ -37,6 +37,8 @@ #include <Imlib.h> #include <Fnlib.h> +#define DEBUG_EWMH 0 + #define XSync(d, f) \ {XImage *__xim; \ __xim = XGetImage(d, root.win, 0, 0, 1, 1, 0xffffffff, ZPixmap); \ @@ -907,6 +909,8 @@ char focusclick; char internal; char neverfocus; + char neverraise; + int ewmh_flags; Menu *menu; Window shownmenu; Dialog *dialog; @@ -921,7 +925,9 @@ Snapshot *snap; int icon_pmap_w, icon_pmap_h; Pixmap icon_pmap, icon_mask; +#if ENABLE_KDE char kde_hint; +#endif int head; } EWin; @@ -1271,12 +1277,14 @@ char nogroup; GroupConfig group_config; char group_swapmove; +#if ENABLE_KDE Window kde_dock; int kde_support; int kde_x1; int kde_x2; int kde_y1; int kde_y2; +#endif char clickalways; char keybinds_changed; char firsttime; @@ -1743,6 +1751,7 @@ } DrawQueue; +#if ENABLE_KDE /* some kde hint enums here */ typedef enum @@ -1765,6 +1774,7 @@ IconChange } KMessage; +#endif /* only used for remember list dialog callback funcs (SettingsDialog() * in in settings.c)... snaps are attached to windows, not a global list */ @@ -2360,6 +2370,7 @@ long *getSimpleHint(Window win, Atom atom); void deleteHint(Window win, Atom atom); +#if ENABLE_GNOME /* gnome.c functions */ void GNOME_GetHintIcons(EWin * ewin, Atom atom_change); void GNOME_SetCurrentDesk(void); @@ -2383,7 +2394,10 @@ void GNOME_SetAreaCount(void); void GNOME_SetWMNameVer(void); void GNOME_DelHints(EWin * ewin); +void GNOME_ProcessClientMessage(XClientMessageEvent * event); +#endif +#if ENABLE_KDE /* kde.c functions */ void KDE_ClientMessage(Window win, Atom atom, long data, @@ -2410,6 +2424,44 @@ void KDE_NewWindow(EWin * ewin); void KDE_RemoveWindow(EWin * ewin); void KDE_UpdateClient(EWin * ewin); +#endif + +#if ENABLE_EWMH +/* ewmh.c functions */ +void EWMH_Init(void); +void EWMH_SetDesktopCount(void); +void EWMH_SetDesktopNames(void); +void EWMH_SetDesktopSize(void); +void EWMH_SetCurrentDesktop(void); +void EWMH_SetDesktopViewport(void); +void EWMH_SetClientList(void); +void EWMH_SetActiveWindow(void); +void EWMH_SetWindowDesktop(const EWin *ewin); +void EWMH_SetWindowState(const EWin *ewin); +void EWMH_GetWindowDesktop(EWin *ewin); +void EWMH_GetWindowState(EWin *ewin); +void EWMH_GetWindowHints(EWin *ewin); +void EWMH_DelWindowHints(const EWin *ewin); +void EWMH_ProcessClientMessage(XClientMessageEvent * event); +void EWMH_ProcessPropertyChange(EWin *ewin, Atom atom_change); +#endif + +/* hints.c functions */ +void HintsInit(void); +void HintsSetDesktopConfig(void); +void HintsSetViewportConfig(void); +void HintsSetCurrentDesktop(void); +void HintsSetDesktopViewport(void); +void HintsSetClientList(void); +void HintsSetActiveWindow(void); +void HintsSetWindowDesktop(EWin *ewin); +void HintsSetWindowArea(EWin *ewin); +void HintsSetWindowState(EWin *ewin); +void HintsSetWindowHints(EWin *ewin); +void HintsGetWindowHints(EWin *ewin); +void HintsDelWindowHints(EWin *ewin); +void HintsProcessPropertyChange(EWin *ewin, Atom atom_change); +void HintsProcessClientMessage(XClientMessageEvent *event); /* sound.c functions */ Sample *LoadWav(char *file); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 22 May 2000 23:59:53 -0000 1.7 +++ Makefile.am 24 Mar 2003 03:48:08 -0000 1.8 @@ -46,16 +46,15 @@ focus.c \ fx.c \ globals.c \ - gnome.c \ grabs.c \ groups.c \ handlers.c \ + hints.c \ icccm.c \ iclass.c \ iconify.c \ init.c \ ipc.c \ - kde.c \ lists.c \ main.c \ memory.c \ @@ -90,7 +89,17 @@ warp.c \ windowmatch.c \ x.c \ - zoom.c + zoom.c \ + $(SRCS_EWMH) $(SRCS_GNOME) $(SRCS_KDE) +if ENABLE_EWMH +SRCS_EWMH = ewmh.c +endif +if ENABLE_GNOME +SRCS_GNOME = gnome.c +endif +if ENABLE_KDE +SRCS_KDE = kde.c +endif LDADD = \ @INTLLIBS@ \ =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -3 -r1.98 -r1.99 --- actions.c 5 Sep 2002 01:16:24 -0000 1.98 +++ actions.c 24 Mar 2003 03:48:08 -0000 1.99 @@ -1467,6 +1467,7 @@ } Efree(blst); } +#if ENABLE_KDE if (mode.kde_support) { fixed = Erealloc(fixed, sizeof(RectBox) * (k + 2)); @@ -1514,6 +1515,7 @@ k++; } +#endif ArrangeRects(fixed, k, floating, j, ret, 0, 0, root.w, root.h, method, 0); for (i = 0; i < (j + k); i++) @@ -1750,7 +1752,6 @@ && ((curr_group && !curr_group->cfg.mirror) || !sticky)) MakeWindowSticky(gwins[i]); params = NULL; - GNOME_SetHint(gwins[i]); RememberImportantInfoForEwin(gwins[i]); } Efree(gwins); @@ -1792,8 +1793,8 @@ ewin->skipwinlist = !(skip); ewin->skipfocus = !(skip); params = NULL; - GNOME_SetHint(ewin); - GNOME_SetClientList(); + HintsSetWindowState(ewin); + HintsSetClientList(); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); @@ -1821,8 +1822,8 @@ ewin->skiptask = !(skiptask); params = NULL; - GNOME_SetHint(ewin); - GNOME_SetClientList(); + HintsSetWindowState(ewin); + HintsSetClientList(); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); @@ -1851,7 +1852,7 @@ ewin->skipfocus = !(skipfocus); params = NULL; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); } @@ -1878,7 +1879,7 @@ ewin->skipwinlist = !(skipwinlist); params = NULL; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); } @@ -1905,7 +1906,7 @@ ewin->neverfocus = !(neverfocus); params = NULL; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); } @@ -3112,6 +3113,7 @@ } ewin->layer = l; RaiseEwin(ewin); + HintsSetWindowState(ewin); RememberImportantInfoForEwin(ewin); EDBUG_RETURN(0); } @@ -3458,8 +3460,10 @@ SettingsAutoRaise(); else if (!strcmp(s, "tooltips")) SettingsTooltips(); +#if ENABLE_KDE else if (!strcmp(s, "kde")) SettingsKDE(); +#endif else if (!strcmp(s, "audio")) SettingsAudio(); else if (!strcmp(s, "fx")) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/areas.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- areas.c 28 Jul 2000 19:13:13 -0000 1.45 +++ areas.c 24 Mar 2003 03:48:08 -0000 1.46 @@ -115,7 +115,7 @@ ah = 1; area_w = aw; area_h = ah; - GNOME_SetAreaCount(); + HintsSetViewportConfig(); PagerReArea(); EDBUG_RETURN_; } @@ -366,7 +366,7 @@ mode.flipp = 0; lst[i]->area_x = a1; lst[i]->area_y = a2; - GNOME_SetEwinArea(lst[i]); + HintsSetWindowArea(lst[i]); } } } @@ -427,7 +427,7 @@ mode.flipp = 0; lst[i]->area_x = a1; lst[i]->area_y = a2; - GNOME_SetEwinArea(lst[i]); + HintsSetWindowArea(lst[i]); } } } @@ -437,8 +437,8 @@ /* set the current area up in out data structs */ desks.desk[desks.current].current_area_x = ax; desks.desk[desks.current].current_area_y = ay; - /* set gnome hints up for it */ - GNOME_SetCurrentArea(); + /* set hints up for it */ + HintsSetDesktopViewport(); XSync(disp, False); /* redraw any windows that were in "move mode" */ mode.moveresize_pending_ewin = NULL; @@ -528,7 +528,7 @@ ewin->y + (root.h * (ay - ewin->area_y))); ewin->area_x = ax; ewin->area_y = ay; - GNOME_SetEwinArea(ewin); + HintsSetWindowArea(ewin); EDBUG_RETURN_; } @@ -538,7 +538,7 @@ EDBUG(4, "SetEwinToCurrentArea"); ewin->area_x = desks.desk[ewin->desktop].current_area_x; ewin->area_y = desks.desk[ewin->desktop].current_area_y; - GNOME_SetEwinArea(ewin); + HintsSetWindowArea(ewin); EDBUG_RETURN_; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/arrange.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -3 -r1.49 -r1.50 --- arrange.c 28 Jul 2000 19:13:13 -0000 1.49 +++ arrange.c 24 Mar 2003 03:48:08 -0000 1.50 @@ -1025,6 +1025,7 @@ newrect.w = ewin->w; newrect.h = ewin->h; newrect.p = ewin->layer; +#if ENABLE_KDE if (mode.kde_support) { ArrangeRects(fixed, j, &newrect, 1, ret, mode.kde_x1, mode.kde_y1, @@ -1032,9 +1033,12 @@ } else { +#endif ArrangeRects(fixed, j, &newrect, 1, ret, 0, 0, root.w, root.h, ARRANGE_BY_SIZE, 1); +#if ENABLE_KDE } +#endif for (i = 0; i < j + 1; i++) { if (ret[i].data == ewin) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -3 -r1.85 -r1.86 --- borders.c 28 Jul 2000 19:13:13 -0000 1.85 +++ borders.c 24 Mar 2003 03:48:08 -0000 1.86 @@ -666,6 +666,7 @@ newrect.w = ewin->w; newrect.h = ewin->h; newrect.p = ewin->layer; +#if ENABLE_KDE if (mode.kde_support) { ArrangeRects(fixed, j, &newrect, 1, ret, mode.kde_x1, @@ -675,9 +676,12 @@ } else { +#endif ArrangeRects(fixed, j, &newrect, 1, ret, 0, 0, root.w, root.h, ARRANGE_BY_SIZE, 1); +#if ENABLE_KDE } +#endif for (i = 0; i < j + 1; i++) { if (ret[i].data == ewin) @@ -1505,12 +1509,13 @@ ICCCM_GetInfo(ewin, 0); ICCCM_GetColormap(ewin); ICCCM_GetShapeInfo(ewin); - GNOME_GetHints(ewin, 0); +/* HintsGetWindowHints(ewin); */ ICCCM_GetGeoms(ewin, 0); SessionGetInfo(ewin, 0); MatchEwinToSM(ewin); MatchEwinToSnapInfo(ewin); ICCCM_GetEInfo(ewin); + HintsGetWindowHints(ewin); if (!ewin->border) SetEwinBorder(ewin); @@ -1690,6 +1695,7 @@ ewin->skipwinlist = 0; ewin->skipfocus = 0; ewin->neverfocus = 0; + ewin->neverraise = 0; ewin->focusclick = 0; ewin->internal = 0; ewin->menu = NULL; @@ -1708,7 +1714,9 @@ ewin->snap = NULL; ewin->icon_pmap = 0; ewin->icon_mask = 0; +#if ENABLE_KDE ewin->kde_hint = 0; +#endif att.event_mask = StructureNotifyMask | ResizeRedirectMask | ButtonPressMask | @@ -1785,10 +1793,7 @@ if (mode.context_ewin == ewin) mode.context_ewin = NULL; - GNOME_DelHints(ewin); - - if (mode.kde_support) - KDE_RemoveWindow(ewin); + HintsDelWindowHints(ewin); if (ewin->client.transient) { @@ -2063,7 +2068,7 @@ (desks.desk[ewin->desktop].current_area_y * root.h)) / root.h; if ((pax != ewin->area_x) || (pay != ewin->area_y)) { - GNOME_SetEwinArea(ewin); + HintsSetWindowArea(ewin); } EDBUG_RETURN_; } @@ -2408,6 +2413,7 @@ PagerEwinOutsideAreaUpdate(ewin); ForceUpdatePagersForDesktop(ewin->desktop); } + HintsSetClientList(); EDBUG_RETURN_; } @@ -2420,6 +2426,10 @@ call_depth++; if (call_depth > 256) EDBUG_RETURN_; + + if (ewin->neverraise) + EDBUG_RETURN_; + if (ewin->win) { if (ewin->floating) @@ -2838,7 +2848,7 @@ } PropagateShapes(ewin->win); queue_up = pq; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); if (mode.mode == MODE_NONE) { PagerEwinOutsideAreaUpdate(ewin); @@ -2922,7 +2932,7 @@ } PropagateShapes(ewin->win); queue_up = pq; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); if (mode.mode == MODE_NONE) { PagerEwinOutsideAreaUpdate(ewin); @@ -3188,7 +3198,7 @@ ewin->client.win, ShapeBounding, ShapeSet); PropagateShapes(ewin->win); queue_up = pq; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); if (mode.mode == MODE_NONE) { PagerEwinOutsideAreaUpdate(ewin); @@ -3459,7 +3469,7 @@ ewin->client.win, ShapeBounding, ShapeSet); PropagateShapes(ewin->win); queue_up = pq; - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); if (mode.mode == MODE_NONE) { PagerEwinOutsideAreaUpdate(ewin); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/comms.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- comms.c 28 Jul 2000 17:23:34 -0000 1.25 +++ comms.c 24 Mar 2003 03:48:08 -0000 1.26 @@ -1546,8 +1546,6 @@ ShowDesktopControls(); } FixFocus(); - GNOME_SetDeskCount(); - GNOME_SetDeskNames(); GetAreaSize(&ax, &ay); GetCurrentArea(&a, &b); if (a >= ax) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- config.c 28 Jul 2000 17:23:34 -0000 1.54 +++ config.c 24 Mar 2003 03:48:08 -0000 1.55 @@ -796,7 +796,10 @@ sscanf(s, "%*s %d %d ", &mode.dockstartx, &mode.dockstarty); break; case CONTROL_KDESUPPORT: +#if ENABLE_KDE + /* Taking out the case causes complaints when starting with old config. */ mode.kde_support = i2; +#endif break; case CONTROL_SHOWROOTTOOLTIP: mode.showroottooltip = i2; @@ -3895,7 +3898,9 @@ fprintf(autosavefile, "1364 %i\n", (int)mode.group_config.shade); fprintf(autosavefile, "1365 %i\n", (int)mode.group_config.mirror); fprintf(autosavefile, "1372 %i\n", (int)mode.group_swapmove); +#if ENABLE_KDE fprintf(autosavefile, "1366 %i\n", (int)mode.kde_support); +#endif fprintf(autosavefile, "1367 %i\n", (int)mode.clickalways); fprintf(autosavefile, "1368 %i\n", (int)mode.showroottooltip); fprintf(autosavefile, "1369 %i %i %i\n", (int)mode.pager_sel_button, =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- desktops.c 28 Jul 2000 19:13:13 -0000 1.32 +++ desktops.c 24 Mar 2003 03:48:08 -0000 1.33 @@ -183,12 +183,7 @@ if (desks.current >= mode.numdesktops) GotoDesktop(mode.numdesktops - 1); - GNOME_SetDeskCount(); - GNOME_SetDeskNames(); - - if (mode.kde_support) - KDE_SetNumDesktops(); - + HintsSetDesktopConfig(); } void @@ -1360,7 +1355,7 @@ ewin->y); ICCCM_Configure(ewin); StackDesktops(); - GNOME_SetEwinDesk(ewin); + HintsSetWindowDesktop(ewin); EDBUG_RETURN_; } if (ewin->floating) @@ -1377,7 +1372,7 @@ XRaiseWindow(disp, ewin->win); ShowEdgeWindows(); ICCCM_Configure(ewin); - GNOME_SetEwinDesk(ewin); + HintsSetWindowDesktop(ewin); EDBUG_RETURN_; } if (ewin->parent != desks.desk[ewin->desktop].win) @@ -1389,7 +1384,8 @@ RaiseEwin(ewin); /* ShowEwin(ewin); */ ICCCM_Configure(ewin); - GNOME_SetEwinDesk(ewin); +/* HintsSetWindowDesktop(ewin); */ + HintsSetWindowHints(ewin); StackDesktops(); SetEwinToCurrentArea(ewin); } @@ -1440,8 +1436,8 @@ XLowerWindow(disp, ewin->win); EMoveWindow(disp, ewin->win, ewin->x, ewin->y); DesktopAddEwinToTop(ewin); - GNOME_SetEwinArea(ewin); - GNOME_SetEwinDesk(ewin); + HintsSetWindowArea(ewin); + HintsSetWindowDesktop(ewin); last_ewin = ewin; } } @@ -1520,10 +1516,7 @@ desks.current = num; MoveStickyWindowsToCurrentDesk(); - GNOME_SetCurrentDesk(); - - if (mode.kde_support) - KDE_SetRootArea(); + HintsSetCurrentDesktop(); if (num > 0) { @@ -1760,7 +1753,7 @@ ForceUpdatePagersForDesktop(num); UpdatePagerSel(); HandleDrawQueue(); - GNOME_SetCurrentDesk(); + HintsSetCurrentDesktop(); EMapWindow(disp, desks.desk[num].win); XSync(disp, False); @@ -1791,7 +1784,7 @@ ForceUpdatePagersForDesktop(deskorder[0]); UpdatePagerSel(); HandleDrawQueue(); - GNOME_SetCurrentDesk(); + HintsSetCurrentDesktop(); XSync(disp, False); EDBUG_RETURN_; @@ -2012,8 +2005,6 @@ } ForceUpdatePagersForDesktop(pdesk); ForceUpdatePagersForDesktop(ewin->desktop); - if (mode.kde_support) - KDE_UpdateClient(ewin); EDBUG_RETURN_; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -3 -r1.98 -r1.99 --- evhandlers.c 28 Jul 2000 19:13:13 -0000 1.98 +++ evhandlers.c 24 Mar 2003 03:48:08 -0000 1.99 @@ -23,25 +23,6 @@ */ #include "E.h" -#define WIN_LAYER_DESKTOP 0 -#define WIN_LAYER_BELOW 2 -#define WIN_LAYER_NORMAL 4 -#define WIN_LAYER_ONTOP 6 -#define WIN_LAYER_DOCK 8 -#define WIN_LAYER_ABOVE_DOCK 10 -#define WIN_LAYER_MENU 12 - -#define WIN_STATE_STICKY (1<<0) /* everyone knows sticky */ -#define WIN_STATE_RESERVED_BIT1 (1<<1) /* removed minimize here */ -#define WIN_STATE_MAXIMIZED_VERT (1<<2) /* window in maximized V state */ -#define WIN_STATE_MAXIMIZED_HORIZ (1<<3) /* window in maximized H state */ -#define WIN_STATE_HIDDEN (1<<4) /* not on taskbar but window visible */ -#define WIN_STATE_SHADED (1<<5) /* shaded (NeXT style) */ -#define WIN_STATE_HID_WORKSPACE (1<<6) /* not on current desktop */ -#define WIN_STATE_HID_TRANSIENT (1<<7) /* owner of transient is hidden */ -#define WIN_STATE_FIXED_POSITION (1<<8) /* window is fixed in position even */ -#define WIN_STATE_ARRANGE_IGNORE (1<<9) /* ignore for auto arranging */ - static ToolTip *ttip = NULL; struct _mdata { @@ -118,19 +99,19 @@ { EWin *ewin; - static Atom a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0; + static Atom a1 = 0, a6 = 0; +#if DEBUG_EWMH + char *name = XGetAtomName(disp, ev->xclient.message_type); + printf("HandleClientMessage: ev_type=%s(%d) ev_win=%#x data[0-3]= %08x %08x %08x %08x\n", + name, ev->xclient.message_type, ev->xclient.window, + ev->xclient.data.l[0], ev->xclient.data.l[1], + ev->xclient.data.l[2], ev->xclient.data.l[3]); + XFree(name); +#endif EDBUG(5, "HandleClientMessage"); if (!a1) a1 = XInternAtom(disp, "ENL_MSG", False); - if (!a2) - a2 = XInternAtom(disp, "_WIN_AREA", False); - if (!a3) - a3 = XInternAtom(disp, "_WIN_WORKSPACE", False); - if (!a4) - a4 = XInternAtom(disp, "_WIN_LAYER", False); - if (!a5) - a5 = XInternAtom(disp, "_WIN_STATE", False); if (!a6) a6 = XInternAtom(disp, "WM_CHANGE_STATE", False); if (ev->xclient.message_type == a1) @@ -138,104 +119,31 @@ HandleComms(ev); EDBUG_RETURN_; } - if (ev->xclient.message_type == a2) - { - SetCurrentArea(ev->xclient.data.l[0], ev->xclient.data.l[1]); - EDBUG_RETURN_; - } - if (ev->xclient.message_type == a3) - { - GotoDesktop(ev->xclient.data.l[0]); - EDBUG_RETURN_; - } - if (ev->xclient.message_type == a4) - { - ewin = - FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); - if (ewin) - { - ewin->layer = ev->xclient.data.l[0]; - XChangeProperty(disp, ewin->win, a4, XA_CARDINAL, 32, - PropModeReplace, - (unsigned char *)(&(ev->xclient.data.l[0])), 1); - RaiseEwin(ewin); - } - EDBUG_RETURN_; - } - if (ev->xclient.message_type == a5) + if (ev->xclient.message_type == a6) { ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); - if (!ewin) + if (ewin == NULL) EDBUG_RETURN_; - if (ev->xclient.data.l[0] & WIN_STATE_FIXED_POSITION) - { - if (ev->xclient.data.l[1] & WIN_STATE_FIXED_POSITION) - ewin->fixedpos = 1; - else - ewin->fixedpos = 0; - } - if (ev->xclient.data.l[0] & WIN_STATE_ARRANGE_IGNORE) + if (ev->xclient.data.l[0] == IconicState) { - if (ev->xclient.data.l[1] & WIN_STATE_ARRANGE_IGNORE) - ewin->ignorearrange = 1; - else - ewin->ignorearrange = 0; - } - if ((ev->xclient.data.l[0] & WIN_STATE_STICKY) - && (!ewin->ignorearrange)) - { - if (ev->xclient.data.l[1] & WIN_STATE_STICKY) - { - if (!(ewin->sticky)) - { - ewin->sticky = 1; - RaiseEwin(ewin); - DrawEwin(ewin); - ApplySclass(FindItem - ("SOUND_WINDOW_STICK", 0, LIST_FINDBY_NAME, - LIST_TYPE_SCLASS)); - } - } - else - { - if (ewin->sticky) - { - ewin->sticky = 0; - RaiseEwin(ewin); - DrawEwin(ewin); - ApplySclass(FindItem - ("SOUND_WINDOW_UNSTICK", 0, LIST_FINDBY_NAME, - LIST_TYPE_SCLASS)); - } - } + if (!(ewin->iconified)) + IconifyEwin(ewin); } - if (ev->xclient.data.l[0] & WIN_STATE_SHADED) +#if 0 + else if (ev->xclient.data.l[0] == NormalState) { - if (ev->xclient.data.l[1] & WIN_STATE_SHADED) - ShadeEwin(ewin); - else - UnShadeEwin(ewin); + if (ewin->iconified) + DeIconifyEwin(ewin); } - GNOME_SetHint(ewin); + HintsSetWindowState(ewin); +#endif EDBUG_RETURN_; } - if (ev->xclient.message_type == a6) - { - ewin = - FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); - if ((ewin) && (ev->xclient.data.l[0] == IconicState) - && (!(ewin->iconified))) - { - IconifyEwin(ewin); - EDBUG_RETURN_; - } - } - if (mode.kde_support) - KDE_ProcessClientMessage(&(ev->xclient)); - EDBUG_RETURN_; + HintsProcessClientMessage(&(ev->xclient)); + EDBUG_RETURN_; } void @@ -300,7 +208,7 @@ { if (!found_ewin) ICCCM_Cmap(NULL); - if (found_ewin) + else if (!(found_ewin->focusclick)) FocusToEWin(found_ewin); mode.mouse_over_win = found_ewin; } @@ -1170,8 +1078,10 @@ mode.context_win = win; +#if ENABLE_KDE if (mode.kde_support) KDE_RemoveModule(win); +#endif if (ewin) { @@ -1221,7 +1131,7 @@ DockDestroy(ewin); DesktopRemoveEwin(ewin); FreeEwin(ewin); - GNOME_SetClientList(); + HintsSetClientList(); EDBUG_RETURN_; } c = FindItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_CLIENT); @@ -1254,13 +1164,9 @@ if (ewin->client.title) strncpy(title, ewin->client.title, 10240); desktop = ewin->desktop; - GNOME_GetHintDesktop(ewin, ev->xproperty.atom); + HintsProcessPropertyChange(ewin, ev->xproperty.atom); if ((desktop != ewin->desktop) && (!ewin->sticky)) MoveEwinToDesktop(ewin, ewin->desktop); - GNOME_GetHintIcons(ewin, ev->xproperty.atom); - GNOME_GetHintAppState(ewin, ev->xproperty.atom); - GNOME_GetExpandedSize(ewin, ev->xproperty.atom); - GNOME_GetHint(ewin, ev->xproperty.atom); ICCCM_GetTitle(ewin, ev->xproperty.atom); ICCCM_GetHints(ewin, ev->xproperty.atom); ICCCM_GetInfo(ewin, ev->xproperty.atom); @@ -1268,15 +1174,19 @@ ICCCM_GetGeoms(ewin, ev->xproperty.atom); SessionGetInfo(ewin, ev->xproperty.atom); SyncBorderToEwin(ewin); +#if ENABLE_KDE if (mode.kde_support) KDE_ClientChange(win, ev->xproperty.atom); +#endif if (ewin->client.title) if (strncmp(title, ewin->client.title, 10240)) { UpdateBorderInfo(ewin); CalcEwinSizes(ewin); +#if ENABLE_KDE if (mode.kde_support) KDE_UpdateClient(ewin); +#endif } if ((ewin->iconified) && (pm != ewin->client.icon_pmap)) { @@ -1308,15 +1218,19 @@ else if (win == root.win) { /* we're in the root window, not in a client */ +#if ENABLE_KDE if (mode.kde_support) { KDE_HintChange(ev->xproperty.atom); } +#endif } +#if ENABLE_KDE else if (mode.kde_support) { KDE_ClientChange(win, ev->xproperty.atom); } +#endif EDBUG_RETURN_; } @@ -1399,7 +1313,7 @@ if ((mode.slideout) && (ewin == mode.ewin)) HideSlideout(mode.slideout, mode.context_win); FreeEwin(ewin); - GNOME_SetClientList(); + HintsSetClientList(); } } EDBUG_RETURN_; @@ -1606,7 +1520,7 @@ RemoveItem(NULL, ewin->client.win, LIST_FINDBY_ID, LIST_TYPE_EWIN); DesktopRemoveEwin(ewin); FreeEwin(ewin); - GNOME_SetClientList(); + HintsSetClientList(); } else HideEwin(ewin); @@ -1631,7 +1545,8 @@ else { AddToFamily(ev->xmap.window); - GNOME_SetClientList(); + HintsSetClientList(); +#if ENABLE_KDE if (mode.kde_support) { EWin *ewin; @@ -1639,8 +1554,8 @@ ewin = FindItem(NULL, ev->xmap.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); KDE_NewWindow(ewin); - } +#endif } EDBUG_RETURN_; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- focus.c 28 Jul 2000 17:23:35 -0000 1.30 +++ focus.c 24 Mar 2003 03:48:08 -0000 1.31 @@ -261,8 +261,7 @@ { if (!mode.cur_menu_mode) mode.context_ewin = ewin; - if (mode.kde_support) - KDE_UpdateFocusedWindow(); + HintsSetActiveWindow(); EDBUG_RETURN_; } /* Never focus a window that's not on the current desktop. That's just dumb. -- mej */ @@ -282,8 +281,7 @@ } if (!mode.cur_menu_mode) mode.context_ewin = ewin; - if (mode.kde_support) - KDE_UpdateFocusedWindow(); + HintsSetActiveWindow(); EDBUG_RETURN_; } mode.windowdestroy = 0; @@ -306,8 +304,7 @@ mode.focuswin = NULL; mode.realfocuswin = NULL; mode.context_ewin = NULL; - if (mode.kde_support) - KDE_UpdateFocusedWindow(); + HintsSetActiveWindow(); EDBUG_RETURN_; } else if (!ewin->menu) @@ -364,8 +361,7 @@ if (mode.focuswin) DoIn("REVERSE_FOCUS_TIMEOUT", 0.5, ReverseTimeout, mode.focuswin->client.win, NULL); - if (mode.kde_support) - KDE_UpdateFocusedWindow(); + HintsSetActiveWindow(); EDBUG_RETURN_; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/gnome.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- gnome.c 26 Jul 2000 18:00:46 -0000 1.17 +++ gnome.c 24 Mar 2003 03:48:08 -0000 1.18 @@ -769,3 +769,104 @@ GNOME_SetWMCheck(); EDBUG_RETURN_; } + + +void +GNOME_ProcessClientMessage(XClientMessageEvent * event) +{ + static Atom a2 = 0, a3 = 0, a4 = 0, a5 = 0; + + EWin *ewin; + + if (!a2) + a2 = XInternAtom(disp, "_WIN_AREA", False); + if (!a3) + a3 = XInternAtom(disp, "_WIN_WORKSPACE", False); + if (!a4) + a4 = XInternAtom(disp, "_WIN_LAYER", False); + if (!a5) + a5 = XInternAtom(disp, "_WIN_STATE", False); + + if (event->message_type == a2) + { + SetCurrentArea(event->data.l[0], event->data.l[1]); + EDBUG_RETURN_; + } + if (event->message_type == a3) + { + GotoDesktop(event->data.l[0]); + EDBUG_RETURN_; + } + if (event->message_type == a4) + { + ewin = + FindItem(NULL, event->window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + if (ewin) + { + ewin->layer = event->data.l[0]; + XChangeProperty(disp, ewin->win, a4, XA_CARDINAL, 32, + PropModeReplace, + (unsigned char *)(&(event->data.l[0])), 1); + RaiseEwin(ewin); + } + EDBUG_RETURN_; + } + if (event->message_type == a5) + { + ewin = + FindItem(NULL, event->window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + if (!ewin) + EDBUG_RETURN_; + if (event->data.l[0] & WIN_STATE_FIXED_POSITION) + { + if (event->data.l[1] & WIN_STATE_FIXED_POSITION) + ewin->fixedpos = 1; + else + ewin->fixedpos = 0; + } + if (event->data.l[0] & WIN_STATE_ARRANGE_IGNORE) + { + if (event->data.l[1] & WIN_STATE_ARRANGE_IGNORE) + ewin->ignorearrange = 1; + else + ewin->ignorearrange = 0; + } + if ((event->data.l[0] & WIN_STATE_STICKY) + && (!ewin->ignorearrange)) + { + if (event->data.l[1] & WIN_STATE_STICKY) + { + if (!(ewin->sticky)) + { + ewin->sticky = 1; + RaiseEwin(ewin); + DrawEwin(ewin); + ApplySclass(FindItem + ("SOUND_WINDOW_STICK", 0, LIST_FINDBY_NAME, + LIST_TYPE_SCLASS)); + } + } + else + { + if (ewin->sticky) + { + ewin->sticky = 0; + RaiseEwin(ewin); + DrawEwin(ewin); + ApplySclass(FindItem + ("SOUND_WINDOW_UNSTICK", 0, LIST_FINDBY_NAME, + LIST_TYPE_SCLASS)); + } + } + } + if (event->data.l[0] & WIN_STATE_SHADED) + { + if (event->data.l[1] & WIN_STATE_SHADED) + ShadeEwin(ewin); + else + UnShadeEwin(ewin); + } + HintsSetWindowState(ewin); + EDBUG_RETURN_; + } +} =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -3 -r1.60 -r1.61 --- iconify.c 4 Feb 2002 15:42:55 -0000 1.60 +++ iconify.c 24 Mar 2003 03:48:08 -0000 1.61 @@ -272,14 +272,14 @@ FocusToEWin(NULL); } } - GNOME_SetClientList(); + HintsSetClientList(); Efree(lst); } } } call_depth--; - KDE_UpdateClient(ewin); + HintsSetWindowState(ewin); EDBUG_RETURN_; } @@ -347,16 +347,15 @@ lst[i]->iconified = 0; } } - GNOME_SetClientList(); + HintsSetClientList(); Efree(lst); } } } call_depth--; - KDE_UpdateClient(ewin); + HintsSetWindowState(ewin); EDBUG_RETURN_; - } void =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -3 -r1.102 -r1.103 --- ipc.c 28 Jul 2000 19:13:13 -0000 1.102 +++ ipc.c 24 Mar 2003 03:48:09 -0000 1.103 @@ -78,7 +78,9 @@ void IPC_GeneralInfo(char *params, Client * c); void IPC_Modules(char *params, Client * c); void IPC_DockConfig(char *params, Client * c); +#if ENABLE_KDE void IPC_KDE(char *params, Client * c); +#endif void IPC_MemDebug(char *params, Client * c); void IPC_Remember(char *params, Client * c); void IPC_CurrentTheme(char *params, Client * c); @@ -512,11 +514,13 @@ " group <groupid> stick <on/off/?>\n" " group <groupid> shade <on/off/?>\n" " group <groupid> mirror <on/off/?>\n"}, +#if ENABLE_KDE { IPC_KDE, "kde", "Turns on and off KDE support", "use \"kde on\" and \"kde off\" to enable/disable support"}, +#endif { IPC_MemDebug, "dump_mem_debug", @@ -747,6 +751,7 @@ return; } +#if ENABLE_KDE void IPC_KDE(char *params, Client * c) { @@ -790,6 +795,7 @@ CommsSend(c, buf); return; } +#endif void IPC_Modules(char *params, Client * c) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- main.c 28 Jul 2000 17:23:35 -0000 1.51 +++ main.c 24 Mar 2003 03:48:09 -0000 1.52 @@ -280,8 +280,7 @@ } Efree(lst); } - /* gnome hints stuff & session initialization here */ - GNOME_SetHints(); + HintsInit(); SessionInit(); ShowDesktopControls(); CheckEvent(); @@ -291,8 +290,8 @@ if (mode.mapslide) CreateStartupDisplay(0); MapUnmap(1); - /* set some more stuff for gnome */ - GNOME_SetCurrentArea(); + /* set some more hints */ + HintsSetDesktopViewport(); desks.current = 0; /* Set up the internal pagers */ IB_Setup(); @@ -308,11 +307,13 @@ XKillClient(disp, init_win_ext); init_win_ext = 0; } - GNOME_SetClientList(); + HintsSetClientList(); +#if ENABLE_KDE /* start up any kde crap we might need to start up */ if (mode.kde_support) KDE_Init(); +#endif /* sync just to make sure */ XSync(disp, False); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- session.c 26 Jul 2000 18:00:47 -0000 1.34 +++ session.c 24 Mar 2003 03:48:09 -0000 1.35 @@ -591,9 +591,11 @@ } else if (!strcmp(s, "restart_wm")) { +#if ENABLE_KDE /* kill off kde */ if (mode.kde_support) KDE_Shutdown(); +#endif AUDIO_PLAY("SOUND_EXIT"); if (sound_fd >= 0) close(sound_fd); @@ -691,9 +693,11 @@ return; } } +#if ENABLE_KDE /* kill off kde */ if (mode.kde_support) KDE_Shutdown(); +#endif AUDIO_PLAY("SOUND_EXIT"); EExit(0); } @@ -1299,9 +1303,11 @@ else if (!strcmp(s, "restart_wm")) { AUDIO_PLAY("SOUND_WAIT"); +#if ENABLE_KDE /* kill off kde */ if (mode.kde_support) KDE_Shutdown(); +#endif XCloseDisplay(disp); disp = NULL; Esnprintf(s, sizeof(s), "exec %s -display %s", atword(params, 2), dstr); @@ -1385,9 +1391,11 @@ else if (!strcmp((char *)s, "error")) EExit(0); +#if ENABLE_KDE /* kill off kde */ if (mode.kde_support) KDE_Shutdown(); +#endif restarting = False; SaveSession(1); AUDIO_PLAY("SOUND_EXIT"); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -3 -r1.68 -r1.69 --- settings.c 28 Jul 2000 21:29:56 -0000 1.68 +++ settings.c 24 Mar 2003 03:48:09 -0000 1.69 @@ -1786,6 +1786,7 @@ ShowDialog(d); } +#if ENABLE_KDE static char tmp_kde; static void CB_ConfigureKDE(int val, void *data); static void @@ -1868,6 +1869,7 @@ DialogBindKey(d, "Return", CB_ConfigureKDE, 0, d); ShowDialog(d); } +#endif static char tmp_dialog_headers; static void CB_ConfigureMiscellaneous(int val, void *data); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -3 -r1.80 -r1.81 --- setup.c 29 Jul 2000 22:32:36 -0000 1.80 +++ setup.c 24 Mar 2003 03:48:09 -0000 1.81 @@ -548,11 +548,13 @@ mode.manual_placement = 0; mode.raise_on_next_focus = 1; mode.raise_after_next_focus = 1; +#if ENABLE_KDE mode.kde_support = 0; mode.kde_x1 = 0; mode.kde_y1 = 0; mode.kde_x2 = root.w; mode.kde_y2 = root.h; +#endif #ifdef WITH_TARTY_WARP mode.display_warp = 1; #else =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/size.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- size.c 28 Jul 2000 17:23:35 -0000 1.23 +++ size.c 24 Mar 2003 03:48:09 -0000 1.24 @@ -48,6 +48,7 @@ { y = ewin->y; h = ewin->h; +#if ENABLE_KDE if (mode.kde_support) { y1 = mode.kde_y1; @@ -55,9 +56,12 @@ } else { +#endif y1 = 0; y2 = root.h; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -130,6 +134,7 @@ { y = ewin->y; h = ewin->h; +#if ENABLE_KDE if (mode.kde_support) { y1 = mode.kde_y1; @@ -137,9 +142,12 @@ } else { +#endif y1 = 0; y2 = root.h; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -247,6 +255,7 @@ { x = ewin->x; w = ewin->w; +#if ENABLE_KDE if (mode.kde_support) { x1 = mode.kde_x1; @@ -254,9 +263,12 @@ } else { +#endif x1 = 0; x2 = root.w; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -329,6 +341,7 @@ { x = ewin->x; w = ewin->w; +#if ENABLE_KDE if (mode.kde_support) { x1 = mode.kde_x1; @@ -336,9 +349,12 @@ } else { +#endif x1 = 0; x2 = root.w; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -450,6 +466,7 @@ h = ewin->h; x = ewin->x; w = ewin->w; +#if ENABLE_KDE if (mode.kde_support) { x1 = mode.kde_x1; @@ -459,11 +476,14 @@ } else { +#endif x1 = 0; x2 = root.w; y1 = 0; y2 = root.h; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -568,6 +588,7 @@ h = ewin->h; x = ewin->x; w = ewin->w; +#if ENABLE_KDE if (mode.kde_support) { x1 = mode.kde_x1; @@ -577,11 +598,14 @@ } else { +#endif x1 = 0; x2 = root.w; y1 = 0; y2 = root.h; +#if ENABLE_KDE } +#endif #ifdef HAS_XINERAMA if (xinerama_active) { @@ -696,8 +720,10 @@ ewin->toggle = 0; } +#if ENABLE_KDE if (mode.kde_support) KDE_UpdateClient(ewin); +#endif return; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/sticky.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- sticky.c 26 Jul 2000 18:00:47 -0000 1.10 +++ sticky.c 24 Mar 2003 03:48:09 -0000 1.11 @@ -30,6 +30,8 @@ if (!ewin) EDBUG_RETURN_; + ewin->sticky = 2; /* Grrr: we are "unsticking" (hack to get the desktop right) */ + ewin->desktop = desks.current; FloatEwinAt(ewin, ewin->x, ewin->y); DrawEwinShape(ewin, 0, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 0); MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y); @@ -37,14 +39,12 @@ RaiseEwin(ewin); DrawEwin(ewin); - if (mode.kde_support) - KDE_UpdateClient(ewin); + HintsSetWindowState(ewin); ApplySclass(FindItem ("SOUND_WINDOW_UNSTICK", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); EDBUG_RETURN_; - } void @@ -58,8 +58,7 @@ RaiseEwin(ewin); DrawEwin(ewin); - if (mode.kde_support) - KDE_UpdateClient(ewin); + HintsSetWindowState(ewin); ApplySclass(FindItem ("SOUND_WINDOW_STICK", 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); |