1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

fixed bug in positioning of window list menu when opened by kbd

internal code clean-up with notifications for window state change and other
stuff, also cleaned kde and gnome support in preparation for wm-spec support..
This commit is contained in:
kojima
2001-09-06 21:42:28 +00:00
parent 86f3e2fdb1
commit 5ef342d905
19 changed files with 413 additions and 303 deletions

View File

@@ -16,6 +16,9 @@ Changes since version 0.65.1:
- added spanish INSTALL file (Efrain Maximiliano Palermo <max_drake2001@yahoo.com.ar>)
- updated Finnish pots (Tomi Kajala <tomi@iki.fi>)
- copy/paste launching in Dock
- fixed bug in positioning of window list menu when opened by kbd
- internal code clean-up with notifications for window state change and other
stuff
Changes since version 0.65.0:
.............................

View File

@@ -83,6 +83,9 @@
/* define if your X server has XInternAtoms() */
#undef HAVE_XINTERNATOMS
/* define if your X server has XConvertCase() */
#undef HAVE_XCONVERTCASE
/* define if you want Hermes support */
#undef HAVE_HERMES

View File

@@ -15,7 +15,7 @@ AC_INIT(src/WindowMaker.h)
AM_INIT_AUTOMAKE(WindowMaker, 0.65.1)
AM_INIT_AUTOMAKE(WindowMaker, 0.66.0)
AM_PROG_LIBTOOL
@@ -100,7 +100,7 @@ dnl not used anywhere
dnl AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo)
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo vsnprintf vasprintf)
@@ -149,11 +149,9 @@ AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
dnl Checks for header files.
dnl =======================
dnl AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
libintl.h sys/select.h poll.h malloc.h)
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h poll.h malloc.h ctype.h stdlib.h string.h strings.h)
@@ -406,6 +404,10 @@ dnl Check whether XInternAtoms() exist
dnl ==================================
AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
dnl Check whether XConvertCase() exist
dnl ==================================
AC_CHECK_LIB(X11, XConvertCase, AC_DEFINE(HAVE_XCONVERTCASE),,$XLFLAGS $XLIBS)
dnl XKB keyboard language status
dnl ============================
@@ -433,14 +435,13 @@ fi
dnl XINERAMA support
dnl ================
xinerama=yes
AC_ARG_ENABLE(xinerama,
[ --disable-xinerama disable XInerama extension support],
xinerama=$enableval, xinerama=yes)
xinerama=no
#AC_ARG_ENABLE(xinerama,
#[ --disable-xinerama disable XInerama extension support],
# xinerama=$enableval, xinerama=yes)
if test "$xinerama" = yes; then
AC_CHECK_LIB(Xext, XineramaQueryScreens, [XLIBS="-lXext $XLIBS"
added_xext=yes
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
fi

View File

@@ -15,7 +15,7 @@ AC_INIT(src/WindowMaker.h)
AM_INIT_AUTOMAKE(WindowMaker, 0.65.1)
AM_INIT_AUTOMAKE(WindowMaker, 0.66.0)
AM_PROG_LIBTOOL
@@ -100,7 +100,7 @@ dnl not used anywhere
dnl AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo)
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo vsnprintf vasprintf)
@@ -149,11 +149,9 @@ AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
dnl Checks for header files.
dnl =======================
dnl AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
libintl.h sys/select.h poll.h malloc.h)
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h poll.h malloc.h ctype.h stdlib.h)
@@ -406,6 +404,10 @@ dnl Check whether XInternAtoms() exist
dnl ==================================
AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
dnl Check whether XConvertCase() exist
dnl ==================================
AC_CHECK_LIB(X11, XConvertCase, AC_DEFINE(HAVE_XCONVERTCASE),,$XLFLAGS $XLIBS)
dnl XKB keyboard language status
dnl ============================
@@ -433,14 +435,13 @@ fi
dnl XINERAMA support
dnl ================
xinerama=yes
xinerama=no
AC_ARG_ENABLE(xinerama,
[ --disable-xinerama disable XInerama extension support],
xinerama=$enableval, xinerama=yes)
if test "$xinerama" = yes; then
AC_CHECK_LIB(Xext, XineramaQueryScreens, [XLIBS="-lXext $XLIBS"
added_xext=yes
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
fi

View File

@@ -490,7 +490,24 @@ extern unsigned int ValidModMask;
extern char WProgramState;
extern char WProgramSigState;
/****** Global Functions ******/
extern void wAbort(Bool dumpCore);
/****** Notifications ******/
extern const char *WMNManaged;
extern const char *WMNUnmanaged;
extern const char *WMNChangedWorkspace;
extern const char *WMNChangedState;
extern const char *WMNChangedFocus;
extern const char *WMNChangedStacking;
extern const char *WMNChangedName;
extern const char *WMNWorkspaceCreated;
extern const char *WMNWorkspaceDestroyed;
extern const char *WMNWorkspaceChanged;
extern const char *WMNWorkspaceNameChanged;
extern const char *WMNResetStacking;
#endif

View File

@@ -167,10 +167,8 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
wApplicationDeactivate(oapp);
#endif
}
#ifdef KWM_HINTS
wKWMUpdateActiveWindowHint(scr);
wKWMSendEventMessage(NULL, WKWMFocusWindow);
#endif
WMPostNotificationName(WMNChangedFocus, NULL, (void*)True);
return;
} else if (old_scr != scr && old_focused) {
wWindowUnfocus(old_focused);
@@ -248,10 +246,7 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
wApplicationActivate(napp);
#endif
}
#ifdef KWM_HINTS
wKWMUpdateActiveWindowHint(scr);
wKWMSendEventMessage(wwin, WKWMFocusWindow);
#endif
XFlush(dpy);
old_scr=scr;
}
@@ -319,15 +314,7 @@ wShadeWindow(WWindow *wwin)
wClientSetState(wwin, IconicState, None);
*/
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
/* update window list to reflect shaded state */
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "shade");
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup) {
@@ -401,17 +388,7 @@ wUnshadeWindow(WWindow *wwin)
if (wwin->flags.focused)
wSetFocusTo(wwin->screen_ptr, wwin);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
/* update window list to reflect unshaded state */
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "shade");
}
@@ -505,14 +482,8 @@ wMaximizeWindow(WWindow *wwin, int directions)
wWindowConfigure(wwin, new_x, new_y, new_width, new_height);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
WMPostNotificationName(WMNChangedState, wwin, "maximize");
wSoundPlay(WSOUND_MAXIMIZE);
}
@@ -538,13 +509,7 @@ wUnmaximizeWindow(WWindow *wwin)
wWindowConfigure(wwin, restore_x, restore_y,
wwin->old_geometry.width, wwin->old_geometry.height);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
WMPostNotificationName(WMNChangedState, wwin, "maximize");
wSoundPlay(WSOUND_UNMAXIMIZE);
}
@@ -809,15 +774,9 @@ unmapTransientsFor(WWindow *wwin)
/*
if (!tmp->flags.shaded)
*/
wClientSetState(tmp, IconicState, None);
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
wKWMSendEventMessage(tmp, WKWMRemoveWindow);
tmp->flags.kwm_hidden_for_modules = 1;
#endif
UpdateSwitchMenu(wwin->screen_ptr, tmp, ACTION_CHANGE_STATE);
wClientSetState(tmp, IconicState, None);
WMPostNotificationName(WMNChangedState, tmp, "iconify-transient");
}
tmp = tmp->prev;
}
@@ -846,17 +805,9 @@ mapTransientsFor(WWindow *wwin)
/*
if (!tmp->flags.shaded)
*/
wClientSetState(tmp, NormalState, None);
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
if (tmp->flags.kwm_hidden_for_modules) {
wKWMSendEventMessage(tmp, WKWMAddWindow);
tmp->flags.kwm_hidden_for_modules = 0;
}
#endif
UpdateSwitchMenu(wwin->screen_ptr, tmp, ACTION_CHANGE_STATE);
wClientSetState(tmp, NormalState, None);
WMPostNotificationName(WMNChangedState, tmp, "iconify-transient");
}
tmp = tmp->prev;
}
@@ -1072,15 +1023,7 @@ wIconifyWindow(WWindow *wwin)
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
wIconSelect(wwin->icon);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "iconify");
}
@@ -1193,15 +1136,7 @@ wDeiconifyWindow(WWindow *wwin)
wArrangeIcons(wwin->screen_ptr, True);
}
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "iconify");
}
@@ -1215,12 +1150,8 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
wwin->icon->mapped = 0;
}
wwin->flags.hidden = 1;
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "hide");
return;
}
@@ -1245,11 +1176,7 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
#endif
wwin->flags.skip_next_animation = 0;
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "hide");
}
@@ -1400,12 +1327,7 @@ unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate,
wUnhideInspectorForWindow(wwin);
}
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wwin, "hide");
}
@@ -1444,7 +1366,7 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
}
wlist->flags.hidden = 0;
UpdateSwitchMenu(scr, wlist, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedState, wlist, "hide");
if (wlist->frame->workspace != scr->current_workspace)
wWindowChangeWorkspace(wlist, scr->current_workspace);

View File

@@ -249,7 +249,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = nextToFocusAfter(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
@@ -260,12 +259,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = nextToFocusBefore(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
@@ -275,7 +271,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
CommitStacking(scr);
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else {
somethingElse = True;

View File

@@ -594,11 +594,11 @@ static void
executeButtonAction(WScreen *scr, XEvent *event, int action)
{
switch(action) {
case WA_SELECT_WINDOWS:
case WA_SELECT_WINDOWS:
wUnselectWindows(scr);
wSelectWindows(scr, event);
break;
case WA_OPEN_APPMENU:
case WA_OPEN_APPMENU:
OpenRootMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
/* ugly hack */
if (scr->root_menu) {
@@ -608,7 +608,7 @@ executeButtonAction(WScreen *scr, XEvent *event, int action)
event->xbutton.window = scr->root_menu->frame->core->window;
}
break;
case WA_OPEN_WINLISTMENU:
case WA_OPEN_WINLISTMENU:
OpenSwitchMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
if (scr->switch_menu) {
if (scr->switch_menu->brother->flags.mapped)
@@ -1379,7 +1379,6 @@ handleKeyPress(XEvent *event)
OpenRootMenu(scr, scr->scr_width/2, scr->scr_height/2, True);
break;
case WKBD_WINDOWLIST:
/*OpenSwitchMenu(scr, event->xkey.x_root, event->xkey.y_root, True);*/
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, True);
break;
#endif /* !LITE */

View File

@@ -43,7 +43,10 @@ void SetupEnvironment(WScreen *scr);
void DispatchEvent(XEvent *event);
#ifndef LITE
#ifdef LITE
#define UpdateSwitchMenu(a,b,c)
#else
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
Bool wRootMenuPerformShortcut(XEvent *event);
@@ -55,6 +58,8 @@ void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
#endif /* !LITE */
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
@@ -63,20 +68,6 @@ void OpenWorkspaceMenu(WScreen *scr, int x, int y);
void CloseWindowMenu(WScreen *scr);
#ifdef LITE
#define UpdateSwitchMenu(a, b, c)
#define UpdateSwitchMenuWorkspace(a, b)
#else /*! LITE */
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
void UpdateSwitchMenuWorkspace(WScreen *scr, int workspace);
#endif /* !LITE */
WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);

View File

@@ -102,6 +102,10 @@ static Atom _XA_WIN_CLIENT_LIST;
static Atom _XA_WIN_DESKTOP_BUTTON_PROXY;
static void observer(void *self, WMNotification *notif);
static void wsobserver(void *self, WMNotification *notif);
void
wGNOMEInitStuff(WScreen *scr)
{
@@ -183,6 +187,17 @@ wGNOMEInitStuff(WScreen *scr)
PropModeReplace, (unsigned char*)supportedStuff, count);
XFlush(dpy);
WMAddNotificationObserver(observer, NULL, WMNManaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNUnmanaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedWorkspace, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedState, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedFocus, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedStacking, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedName, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, NULL);
}
@@ -328,8 +343,8 @@ wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace)
XGetWindowAttributes(dpy, wwin->client_win, &wattribs);
wClientGetNormalHints(wwin, &wattribs, False,
&area->area.x1, &area->area.y1,
&area->area.x2, &area->area.y2);
&area->area.x1, &area->area.y1,
&area->area.x2, &area->area.y2);
area->area.x2 = area->area.x2 + area->area.x1;
area->area.y2 = area->area.y2 + area->area.y1;
@@ -521,7 +536,6 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
}
} else if (event->message_type == _XA_WIN_STATE) {
int flags, mask;
Bool updateWindowList = False;
int maximize = 0;
mask = event->data.l[0];
@@ -529,9 +543,7 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
if (mask & WIN_STATE_STICKY) {
if ((flags & WIN_STATE_STICKY) != WFLAGP(wwin, omnipresent)) {
wwin->client_flags.omnipresent = (flags & WIN_STATE_STICKY)!=0;
wGNOMEUpdateClientStateHint(wwin, False);
updateWindowList = True;
wWindowSetOmnipresent(wwin, (flags & WIN_STATE_STICKY)!=0);
}
}
@@ -561,7 +573,6 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
if ((maximize & both) && !(wwin->flags.maximized & both)) {
wMaximizeWindow(wwin, maximize);
}
updateWindowList = False;
#undef both
}
@@ -571,13 +582,8 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
wUnshadeWindow(wwin);
else
wShadeWindow(wwin);
updateWindowList = False;
}
}
if (updateWindowList) {
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
}
} else if (event->message_type == _XA_WIN_WORKSPACE) {
if (event->data.l[0] != wwin->frame->workspace) {
@@ -639,4 +645,45 @@ wGNOMERemoveClient(WWindow *wwin)
}
static void observer(void *self, WMNotification *notif)
{
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
if (strcmp(name, WMNManaged) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, True);
wGNOMEUpdateClientListHint(wwin->screen_ptr);
} else if (strcmp(name, WMNUnmanaged) == 0 && wwin) {
wGNOMERemoveClient(wwin);
} else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, True);
} else if (strcmp(name, WMNChangedState) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, False);
}
}
static void wsobserver(void *self, WMNotification *notif)
{
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
if (strcmp(name, WMNWorkspaceCreated) == 0) {
wGNOMEUpdateWorkspaceHints(scr);
} else if (strcmp(name, WMNWorkspaceDestroyed) == 0) {
wGNOMEUpdateWorkspaceHints(scr);
} else if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
wGNOMEUpdateWorkspaceNamesHint(scr);
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
wGNOMEUpdateCurrentWorkspaceHint(scr);
} else if (strcmp(name, WMNResetStacking) == 0) {
}
}
#endif /* GNOME_STUFF */

139
src/kwm.c
View File

@@ -232,6 +232,11 @@ enum {
static void observer(void *self, WMNotification *notif);
static void wsobserver(void *self, WMNotification *notif);
static Bool
getSimpleHint(Window win, Atom atom, long *retval)
{
@@ -637,6 +642,23 @@ wKWMInitStuff(WScreen *scr)
SETSTR(KWM_STRING_TODESKTOP, _("Move To"));
SETSTR(KWM_STRING_ONTOCURRENTDESKTOP, _("Bring Here"));
#undef SETSTR
/* catch any notifications from any objects */
WMAddNotificationObserver(observer, scr, WMNManaged, NULL);
WMAddNotificationObserver(observer, scr, WMNUnmanaged, NULL);
WMAddNotificationObserver(observer, scr, WMNChangedWorkspace, NULL);
WMAddNotificationObserver(observer, scr, WMNChangedState, NULL);
WMAddNotificationObserver(observer, scr, WMNChangedFocus, NULL);
WMAddNotificationObserver(observer, scr, WMNChangedStacking, NULL);
WMAddNotificationObserver(observer, scr, WMNChangedName, NULL);
WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceCreated, NULL);
WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceDestroyed, NULL);
WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceChanged, NULL);
WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceNameChanged, NULL);
WMAddNotificationObserver(wsobserver, scr, WMNResetStacking, NULL);
}
@@ -846,10 +868,7 @@ wKWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event)
if (flag != wwin->client_flags.omnipresent) {
wwin->client_flags.omnipresent = flag;
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
wWindowSetOmnipresent(wwin, flag);
}
} else if (event->atom == _XA_KWM_WIN_MAXIMIZED) {
int bla = 0;
@@ -1039,8 +1058,7 @@ performWindowCommand(WScreen *scr, char *command)
} else if (strcmp(command, "winSticky")==0) {
if (wwin) {
wwin->client_flags.omnipresent ^= 1;
UpdateSwitchMenu(scr, wwin, ACTION_CHANGE_WORKSPACE);
wWindowSetOmnipresent(wwin, !wwin->client_flags.omnipresent);
}
} else if (strcmp(command, "winShade")==0) {
@@ -1676,7 +1694,7 @@ wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message)
sendToModules(wwin ? wwin->screen_ptr : NULL, msg, wwin, 0);
}
#if 0
static void
writeSocket(int sock, char *data)
{
@@ -1772,7 +1790,7 @@ connectKFM(WScreen *scr)
return sock;
}
#endif
void
wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control)
@@ -1795,4 +1813,109 @@ wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control)
}
static void observer(void *self, WMNotification *notif)
{
WScreen *scr = (WScreen*)self;
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
void *data = WMGetNotificationClientData(notif);
if (strcmp(name, WMNManaged) == 0 && wwin) {
wKWMUpdateClientWorkspace(wwin);
wKWMUpdateClientStateHint(wwin, KWMAllFlags);
wwin->flags.kwm_managed = 1;
wKWMSendEventMessage(wwin, WKWMAddWindow);
} else if (strcmp(name, WMNUnmanaged) == 0 && wwin) {
wwin->frame->workspace = -1;
wKWMUpdateClientWorkspace(wwin);
wKWMSendEventMessage(wwin, WKWMRemoveWindow);
} else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) {
wKWMUpdateClientWorkspace(wwin);
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(name, WMNChangedFocus) == 0) {
wKWMUpdateActiveWindowHint(scr);
wKWMSendEventMessage(wwin, WKWMFocusWindow);
} else if (strcmp(name, WMNChangedName) == 0) {
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(name, WMNChangedState) == 0) {
char *detail = (char*)data;
if (strcmp(detail, "shade") == 0) {
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(detail, "omnipresent") == 0) {
wKWMUpdateClientStateHint(wwin, KWMStickyFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(detail, "maximize") == 0) {
wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(detail, "iconify-transient") == 0) {
if (wwin->flags.miniaturized) {
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMRemoveWindow);
wwin->flags.kwm_hidden_for_modules = 1;
} else {
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
if (wwin->flags.kwm_hidden_for_modules) {
wKWMSendEventMessage(wwin, WKWMAddWindow);
wwin->flags.kwm_hidden_for_modules = 0;
}
}
} else if (strcmp(detail, "iconify") == 0) {
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
} else if (strcmp(detail, "hide") == 0) {
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
wKWMSendEventMessage(wwin, WKWMChangedClient);
}
} else if (strcmp(name, WMNChangedStacking) == 0 && wwin) {
if (data == NULL)
wKWMBroadcastStacking(wwin->screen_ptr);
else if (strcmp(data, "lower") == 0)
wKWMSendEventMessage(wwin, WKWMLowerWindow);
else if (strcmp(data, "raise") == 0)
wKWMSendEventMessage(wwin, WKWMRaiseWindow);
}
}
static void wsobserver(void *self, WMNotification *notif)
{
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
void *data = WMGetNotificationClientData(notif);
if (strcmp(name, WMNWorkspaceCreated) == 0) {
if (!scr->flags.kwm_syncing_count) {
wKWMUpdateWorkspaceCountHint(scr);
wKWMUpdateWorkspaceNameHint(scr, (int)data);
}
#ifdef not_used
wKWMSetUsableAreaHint(scr, scr->workspace_count-1);
#endif
} else if (strcmp(name, WMNWorkspaceDestroyed) == 0) {
wKWMUpdateWorkspaceCountHint(scr);
} else if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
wKWMUpdateWorkspaceNameHint(scr, (int)data);
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
wKWMUpdateCurrentWorkspaceHint(scr);
} else if (strcmp(name, WMNResetStacking) == 0) {
wKWMBroadcastStacking(scr);
}
}
#endif /* KWM_HINTS */

View File

@@ -147,6 +147,23 @@ char WDelayedActionSet = 0;
int wVisualID = -1;
/* notifications */
const char *WMNManaged = "WMNManaged";
const char *WMNUnmanaged = "WMNUnmanaged";
const char *WMNChangedWorkspace = "WMNChangedWorkspace";
const char *WMNChangedState = "WMNChangedState";
const char *WMNChangedFocus = "WMNChangedFocus";
const char *WMNChangedStacking = "WMNChangedStacking";
const char *WMNChangedName = "WMNChangedName";
const char *WMNWorkspaceCreated = "WMNWorkspaceCreated";
const char *WMNWorkspaceDestroyed = "WMNWorkspaceDestroyed";
const char *WMNWorkspaceChanged = "WMNWorkspaceChanged";
const char *WMNWorkspaceNameChanged = "WMNWorkspaceNameChanged";
const char *WMNResetStacking = "WMNResetStacking";
/******** End Global Variables *****/
static char *DisplayName = NULL;

View File

@@ -35,9 +35,7 @@
#include "actions.h"
#include "properties.h"
#include "stacking.h"
#ifdef KWM_HINTS
#include "kwm.h"
#endif
/*** Global Variables ***/
extern XContext wStackContext;
@@ -45,6 +43,14 @@ extern XContext wStackContext;
extern WPreferences wPreferences;
static void notifyStackChange(WCoreWindow *frame, char *detail)
{
WWindow *wwin = wWindowFor(frame->window);
WMPostNotificationName(WMNChangedStacking, wwin, detail);
}
/*
*----------------------------------------------------------------------
* RemakeStackList--
@@ -145,11 +151,9 @@ CommitStacking(WScreen *scr)
}
XRestackWindows(dpy, windows, i);
wfree(windows);
#ifdef KWM_HINTS
wKWMBroadcastStacking(scr);
#endif
WMPostNotificationName(WMNResetStacking, scr, NULL);
}
/*
@@ -172,10 +176,6 @@ moveFrameToUnder(WCoreWindow *under, WCoreWindow *frame)
wins[0] = under->window;
wins[1] = frame->window;
XRestackWindows(dpy, wins, 2);
#ifdef KWM_HINTS
wKWMBroadcastStacking(under->screen_ptr);
#endif
}
/*
@@ -253,18 +253,12 @@ again:
} else {
moveFrameToUnder(frame->stacking->above, frame);
}
#ifdef KWM_HINTS
{
WWindow *wwin = wWindowFor(frame->window);
if (wwin != NULL)
wKWMSendEventMessage(wwin, WKWMRaiseWindow);
}
#endif
notifyStackChange(frame, "raise");
#ifdef VIRTUAL_DESKTOP
wWorkspaceRaiseEdge(scr);
#endif
}
@@ -374,15 +368,8 @@ wLowerFrame(WCoreWindow *frame)
} else {
moveFrameToUnder(frame->stacking->above, frame);
}
#ifdef KWM_HINTS
{
WWindow *wwin = wWindowFor(frame->window);
if (wwin)
wKWMSendEventMessage(wwin, WKWMLowerWindow);
}
#endif
notifyStackChange(frame, "lower");
}
@@ -446,8 +433,7 @@ AddToStackList(WCoreWindow *frame)
curtop->stacking->above = frame;
WMSetInBag(scr->stacking_list, index, frame);
}
CommitStacking(scr);
CommitStacking(scr);
}
@@ -516,7 +502,8 @@ MoveInStackListAbove(WCoreWindow *next, WCoreWindow *frame)
} else {
moveFrameToUnder(frame->stacking->above, frame);
}
WMPostNotificationName(WMNResetStacking, scr, NULL);
}
@@ -561,6 +548,8 @@ MoveInStackListUnder(WCoreWindow *prev, WCoreWindow *frame)
frame->stacking->under = prev->stacking->under;
prev->stacking->under = frame;
moveFrameToUnder(prev, frame);
WMPostNotificationName(WMNResetStacking, scr, NULL);
}

View File

@@ -46,6 +46,10 @@ extern WPreferences wPreferences;
extern Time LastTimestamp;
static void observer(void *self, WMNotification *notif);
static void wsobserver(void *self, WMNotification *notif);
/*
* FocusWindow
*
@@ -91,6 +95,22 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
{
WMenu *switchmenu = scr->switch_menu;
WWindow *wwin;
static int initialized = 0;
if (!initialized) {
initialized = 1;
WMAddNotificationObserver(observer, NULL, WMNManaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNUnmanaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedWorkspace, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedState, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedFocus, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedStacking, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedName, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, NULL);
}
if (switchmenu) {
if (switchmenu->flags.mapped) {
@@ -106,6 +126,9 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
x-switchmenu->frame->core->width/2, y);
}
} else {
if (keyboard && x==scr->scr_width/2 && y==scr->scr_height/2) {
y = y - switchmenu->frame->core->height/2;
}
wMenuMapAt(switchmenu, x-switchmenu->frame->core->width/2, y,
keyboard);
}
@@ -175,7 +198,7 @@ menuIndexForWindow(WMenu *menu, WWindow *wwin, int old_pos)
/*
* Update switch menu
*/
void
void
UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
{
WMenu *switchmenu = scr->switch_menu;
@@ -278,7 +301,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
int idx = -1;
char *t, *rt;
int it, ion;
if (IS_OMNIPRESENT(wwin)) {
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
"[*]");
@@ -367,7 +390,7 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
if (IS_OMNIPRESENT(wwin))
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[*]");
else
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[%s]",
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[%s]",
scr->workspaces[wwin->frame->workspace]->name);
menu->flags.realized = 0;
}
@@ -377,4 +400,45 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
}
static void observer(void *self, WMNotification *notif)
{
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
void *data = WMGetNotificationClientData(notif);
if (strcmp(name, WMNManaged) == 0 && wwin)
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
else if (strcmp(name, WMNUnmanaged) == 0 && wwin)
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_REMOVE);
else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin)
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
else if (strcmp(name, WMNChangedFocus) == 0 && wwin)
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
else if (strcmp(name, WMNChangedName) == 0 && wwin)
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE);
else if (strcmp(name, WMNChangedState) == 0 && wwin) {
if (strcmp((char*)data, "omnipresent") == 0) {
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
} else {
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
}
}
}
static void wsobserver(void *self, WMNotification *notif)
{
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
void *data = WMGetNotificationClientData(notif);
if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
UpdateSwitchMenuWorkspace(scr, (int)data);
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
}
}
#endif /* !LITE */

View File

@@ -96,6 +96,7 @@ extern Time LastTimestamp;
extern void DoWindowBirth(WWindow*);
/***** Local Stuff *****/
@@ -1215,16 +1216,7 @@ wManageWindow(WScreen *scr, Window window)
/* Update name must come after WApplication stuff is done */
wWindowUpdateName(wwin, title);
if (title)
XFree(title);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, True);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientWorkspace(wwin);
wKWMUpdateClientStateHint(wwin, KWMAllFlags);
#endif
XFree(title);
XUngrabServer(dpy);
@@ -1250,19 +1242,14 @@ wManageWindow(WScreen *scr, Window window)
if (!WFLAGP(wwin, no_bind_keys)) {
wWindowSetKeyGrabs(wwin);
}
#ifdef GNOME_STUFF
wGNOMEUpdateClientListHint(scr);
#endif
#ifdef KWM_HINTS
wwin->flags.kwm_managed = 1;
wKWMSendEventMessage(wwin, WKWMAddWindow);
#endif
WMPostNotificationName(WMNManaged, wwin, NULL);
wColormapInstallForWindow(scr, scr->cmap_window);
UpdateSwitchMenu(scr, wwin, ACTION_ADD);
#ifdef OLWM_HINTS
if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL
&& !WFLAGP(wwin, no_close_button) && !withdraw) {
@@ -1448,8 +1435,6 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
wWindowSetKeyGrabs(wwin);
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
return wwin;
}
@@ -1477,12 +1462,6 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
WScreen *scr = wwin->screen_ptr;
#ifdef KWM_HINTS
wwin->frame->workspace = -1;
wKWMUpdateClientWorkspace(wwin);
#endif
/* First close attribute editor window if open */
if (wwin->flags.inspector_open) {
wCloseInspectorForWindow(wwin);
@@ -1517,8 +1496,6 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
XFlush(dpy);
UpdateSwitchMenu(scr, wwin, ACTION_REMOVE);
/* reparent the window back to the root */
if (restore)
wClientRestore(wwin);
@@ -1609,12 +1586,7 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
}
if (!wwin->flags.internal_window) {
#ifdef GNOME_STUFF
wGNOMERemoveClient(wwin);
#endif
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMRemoveWindow);
#endif
WMPostNotificationName(WMNUnmanaged, wwin, NULL);
}
#ifdef DEBUG
@@ -1681,13 +1653,13 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
wwin->flags.semi_focused = 0;
if (wwin->flags.is_gnustep == 0)
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
wwin->flags.focused = 1;
wWindowResetMouseGrabs(wwin);
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedFocus, wwin, (void*)True);
if (owin == wwin || !owin)
return;
@@ -1737,8 +1709,8 @@ wWindowUnfocus(WWindow *wwin)
CloseWindowMenu(wwin->screen_ptr);
if (wwin->flags.is_gnustep == 0)
wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused
? WS_PFOCUSED : WS_UNFOCUSED);
wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused
? WS_PFOCUSED : WS_UNFOCUSED);
if (wwin->transient_for!=None
&& wwin->transient_for!=wwin->screen_ptr->root_win) {
@@ -1756,8 +1728,7 @@ wWindowUnfocus(WWindow *wwin)
wWindowResetMouseGrabs(wwin);
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
WMPostNotificationName(WMNChangedFocus, wwin, (void*)False);
}
@@ -1766,9 +1737,8 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
{
WApplication *app = wApplicationOf(wwin->main_window);
int instIndex = 0;
Bool res;
char prefix[32] = "";
char *tmp, *title;
char *title;
if (!wwin->frame)
return;
@@ -1782,10 +1752,8 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
if (!newTitle) {
/* the hint was removed */
title = DEF_WINDOW_TITLE;
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
WMPostNotificationName(WMNChangedName, wwin, NULL);
} else {
title = newTitle;
}
@@ -1799,11 +1767,8 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
#endif
if (wFrameWindowChangeTitle(wwin->frame, title)) {
/* only update the menu if the title has actually changed */
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE);
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
WMPostNotificationName(WMNChangedName, wwin, NULL);
}
#ifndef NO_WINDOW_ENUMERATOR
@@ -1996,16 +1961,13 @@ wWindowChangeWorkspace(WWindow *wwin, int workspace)
}
}
if (!IS_OMNIPRESENT(wwin)) {
int oldWorkspace = wwin->frame->workspace;
wwin->frame->workspace = workspace;
UpdateSwitchMenu(scr, wwin, ACTION_CHANGE_WORKSPACE);
WMPostNotificationName(WMNChangedWorkspace, wwin, (void*)oldWorkspace);
}
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, True);
#endif
#ifdef KWM_HINTS
wKWMUpdateClientWorkspace(wwin);
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
if (unmap) {
wWindowUnmap(wwin);
}
@@ -2812,6 +2774,15 @@ wWindowDeleteSavedStatesForPID(pid_t pid)
}
void
wWindowSetOmnipresent(WWindow *wwin, Bool flag)
{
wwin->flags.omnipresent = flag;
WMPostNotificationName(WMNChangedState, wwin, "omnipresent");
}
/* ====================================================================== */
static void

View File

@@ -401,4 +401,6 @@ void wWindowDeleteSavedState(WMagicNumber id);
Bool wWindowObscuresWindow(WWindow *wwin, WWindow *obscured);
void wWindowSetOmnipresent(WWindow *wwin, Bool flag);
#endif

View File

@@ -98,11 +98,7 @@ execWindowOptionCommand(WMenu *menu, WMenuEntry *entry)
break;
case WO_OMNIPRESENT:
wwin->flags.omnipresent^=1;
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
wWindowSetOmnipresent(wwin, !wwin->flags.omnipresent);
break;
}
}

View File

@@ -47,6 +47,7 @@
#include "dock.h"
#include "client.h"
#include <proplist.h>
@@ -876,7 +877,7 @@ applySettings(WMButton *button, InspectorPanel *panel)
skip_window_list ? ACTION_REMOVE : ACTION_ADD);
} else {
if (WFLAGP(wwin, omnipresent) != old_omnipresent) {
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
WMPostNotificationName(WMNChangedState, wwin, "omnipresent");
}
}

View File

@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include "wconfig.h"
@@ -46,9 +46,6 @@
#include "actions.h"
#include "workspace.h"
#include "appicon.h"
#ifdef GNOME_STUFF
#include "gnome.h"
#endif
#ifdef KWM_HINTS
#include "kwm.h"
#endif
@@ -134,18 +131,8 @@ wWorkspaceNew(WScreen *scr)
wspace->height = scr->scr_height;
wspace->width = scr->scr_width;
#endif
#ifdef GNOME_STUFF
wGNOMEUpdateWorkspaceHints(scr);
#endif
#ifdef KWM_HINTS
if (!scr->flags.kwm_syncing_count) {
wKWMUpdateWorkspaceCountHint(scr);
wKWMUpdateWorkspaceNameHint(scr, scr->workspace_count-1);
}
#ifdef not_used
wKWMSetUsableAreaHint(scr, scr->workspace_count-1);
#endif
#endif
WMPostNotificationName(WMNWorkspaceCreated, scr,
(void*)(scr->workspace_count-1));
XFlush(dpy);
return scr->workspace_count-1;
@@ -220,12 +207,8 @@ wWorkspaceDelete(WScreen *scr, int workspace)
wMenuRealize(menu);
}
#ifdef GNOME_STUFF
wGNOMEUpdateWorkspaceHints(scr);
#endif
#ifdef KWM_HINTS
wKWMUpdateWorkspaceCountHint(scr);
#endif
WMPostNotificationName(WMNWorkspaceDestroyed, scr,
(void*)(scr->workspace_count-1));
if (scr->current_workspace >= scr->workspace_count)
wWorkspaceChange(scr, scr->workspace_count-1);
@@ -622,12 +605,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
showWorkspaceName(scr, workspace);
#ifdef GNOME_STUFF
wGNOMEUpdateCurrentWorkspaceHint(scr);
#endif
#ifdef KWM_HINTS
wKWMUpdateCurrentWorkspaceHint(scr);
#endif
WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)workspace);
/* XSync(dpy, False); */
}
@@ -919,17 +898,10 @@ wWorkspaceRename(WScreen *scr, int workspace, char *name)
}
}
UpdateSwitchMenuWorkspace(scr, workspace);
if (scr->clip_icon)
wClipIconPaint(scr->clip_icon);
#ifdef GNOME_STUFF
wGNOMEUpdateWorkspaceNamesHint(scr);
#endif
#ifdef KWM_HINTS
wKWMUpdateWorkspaceNameHint(scr, workspace);
#endif
WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)workspace);
}
@@ -1112,13 +1084,9 @@ wWorkspaceRestoreState(WScreen *scr)
}
}
}
#ifdef KWM_HINTS
wKWMUpdateWorkspaceNameHint(scr, i);
#endif
WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)i);
}
#ifdef GNOME_STUFF
wGNOMEUpdateWorkspaceNamesHint(scr);
#endif
}