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:
@@ -16,6 +16,9 @@ Changes since version 0.65.1:
|
|||||||
- added spanish INSTALL file (Efrain Maximiliano Palermo <max_drake2001@yahoo.com.ar>)
|
- added spanish INSTALL file (Efrain Maximiliano Palermo <max_drake2001@yahoo.com.ar>)
|
||||||
- updated Finnish pots (Tomi Kajala <tomi@iki.fi>)
|
- updated Finnish pots (Tomi Kajala <tomi@iki.fi>)
|
||||||
- copy/paste launching in Dock
|
- 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:
|
Changes since version 0.65.0:
|
||||||
.............................
|
.............................
|
||||||
|
|||||||
@@ -83,6 +83,9 @@
|
|||||||
/* define if your X server has XInternAtoms() */
|
/* define if your X server has XInternAtoms() */
|
||||||
#undef HAVE_XINTERNATOMS
|
#undef HAVE_XINTERNATOMS
|
||||||
|
|
||||||
|
/* define if your X server has XConvertCase() */
|
||||||
|
#undef HAVE_XCONVERTCASE
|
||||||
|
|
||||||
/* define if you want Hermes support */
|
/* define if you want Hermes support */
|
||||||
#undef HAVE_HERMES
|
#undef HAVE_HERMES
|
||||||
|
|
||||||
|
|||||||
23
configure.ac
23
configure.ac
@@ -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
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ dnl not used anywhere
|
|||||||
dnl AC_FUNC_MEMCMP
|
dnl AC_FUNC_MEMCMP
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_FUNC_ALLOCA
|
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 Checks for header files.
|
||||||
dnl =======================
|
dnl =======================
|
||||||
dnl AC_HEADER_STDC
|
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.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)
|
||||||
libintl.h sys/select.h poll.h malloc.h)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -406,6 +404,10 @@ dnl Check whether XInternAtoms() exist
|
|||||||
dnl ==================================
|
dnl ==================================
|
||||||
AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
|
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 XKB keyboard language status
|
||||||
dnl ============================
|
dnl ============================
|
||||||
@@ -433,14 +435,13 @@ fi
|
|||||||
|
|
||||||
dnl XINERAMA support
|
dnl XINERAMA support
|
||||||
dnl ================
|
dnl ================
|
||||||
xinerama=yes
|
xinerama=no
|
||||||
AC_ARG_ENABLE(xinerama,
|
#AC_ARG_ENABLE(xinerama,
|
||||||
[ --disable-xinerama disable XInerama extension support],
|
#[ --disable-xinerama disable XInerama extension support],
|
||||||
xinerama=$enableval, xinerama=yes)
|
# xinerama=$enableval, xinerama=yes)
|
||||||
|
|
||||||
if test "$xinerama" = yes; then
|
if test "$xinerama" = yes; then
|
||||||
AC_CHECK_LIB(Xext, XineramaQueryScreens, [XLIBS="-lXext $XLIBS"
|
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
|
||||||
added_xext=yes
|
|
||||||
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
|
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
17
configure.in
17
configure.in
@@ -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
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ dnl not used anywhere
|
|||||||
dnl AC_FUNC_MEMCMP
|
dnl AC_FUNC_MEMCMP
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_FUNC_ALLOCA
|
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 Checks for header files.
|
||||||
dnl =======================
|
dnl =======================
|
||||||
dnl AC_HEADER_STDC
|
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.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)
|
||||||
libintl.h sys/select.h poll.h malloc.h)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -406,6 +404,10 @@ dnl Check whether XInternAtoms() exist
|
|||||||
dnl ==================================
|
dnl ==================================
|
||||||
AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
|
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 XKB keyboard language status
|
||||||
dnl ============================
|
dnl ============================
|
||||||
@@ -433,14 +435,13 @@ fi
|
|||||||
|
|
||||||
dnl XINERAMA support
|
dnl XINERAMA support
|
||||||
dnl ================
|
dnl ================
|
||||||
xinerama=yes
|
xinerama=no
|
||||||
AC_ARG_ENABLE(xinerama,
|
AC_ARG_ENABLE(xinerama,
|
||||||
[ --disable-xinerama disable XInerama extension support],
|
[ --disable-xinerama disable XInerama extension support],
|
||||||
xinerama=$enableval, xinerama=yes)
|
xinerama=$enableval, xinerama=yes)
|
||||||
|
|
||||||
if test "$xinerama" = yes; then
|
if test "$xinerama" = yes; then
|
||||||
AC_CHECK_LIB(Xext, XineramaQueryScreens, [XLIBS="-lXext $XLIBS"
|
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
|
||||||
added_xext=yes
|
|
||||||
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
|
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -490,7 +490,24 @@ extern unsigned int ValidModMask;
|
|||||||
extern char WProgramState;
|
extern char WProgramState;
|
||||||
extern char WProgramSigState;
|
extern char WProgramSigState;
|
||||||
|
|
||||||
|
|
||||||
/****** Global Functions ******/
|
/****** Global Functions ******/
|
||||||
extern void wAbort(Bool dumpCore);
|
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
|
#endif
|
||||||
|
|||||||
120
src/actions.c
120
src/actions.c
@@ -167,10 +167,8 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
|||||||
wApplicationDeactivate(oapp);
|
wApplicationDeactivate(oapp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateActiveWindowHint(scr);
|
WMPostNotificationName(WMNChangedFocus, NULL, (void*)True);
|
||||||
wKWMSendEventMessage(NULL, WKWMFocusWindow);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
} else if (old_scr != scr && old_focused) {
|
} else if (old_scr != scr && old_focused) {
|
||||||
wWindowUnfocus(old_focused);
|
wWindowUnfocus(old_focused);
|
||||||
@@ -248,10 +246,7 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
|||||||
wApplicationActivate(napp);
|
wApplicationActivate(napp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateActiveWindowHint(scr);
|
|
||||||
wKWMSendEventMessage(wwin, WKWMFocusWindow);
|
|
||||||
#endif
|
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
old_scr=scr;
|
old_scr=scr;
|
||||||
}
|
}
|
||||||
@@ -319,15 +314,7 @@ wShadeWindow(WWindow *wwin)
|
|||||||
wClientSetState(wwin, IconicState, None);
|
wClientSetState(wwin, IconicState, None);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "shade");
|
||||||
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);
|
|
||||||
|
|
||||||
#ifdef ANIMATIONS
|
#ifdef ANIMATIONS
|
||||||
if (!wwin->screen_ptr->flags.startup) {
|
if (!wwin->screen_ptr->flags.startup) {
|
||||||
@@ -401,17 +388,7 @@ wUnshadeWindow(WWindow *wwin)
|
|||||||
if (wwin->flags.focused)
|
if (wwin->flags.focused)
|
||||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "shade");
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -505,14 +482,8 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
|||||||
|
|
||||||
wWindowConfigure(wwin, new_x, new_y, new_width, new_height);
|
wWindowConfigure(wwin, new_x, new_y, new_width, new_height);
|
||||||
|
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag);
|
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wSoundPlay(WSOUND_MAXIMIZE);
|
wSoundPlay(WSOUND_MAXIMIZE);
|
||||||
}
|
}
|
||||||
@@ -538,13 +509,7 @@ wUnmaximizeWindow(WWindow *wwin)
|
|||||||
wWindowConfigure(wwin, restore_x, restore_y,
|
wWindowConfigure(wwin, restore_x, restore_y,
|
||||||
wwin->old_geometry.width, wwin->old_geometry.height);
|
wwin->old_geometry.width, wwin->old_geometry.height);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag);
|
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wSoundPlay(WSOUND_UNMAXIMIZE);
|
wSoundPlay(WSOUND_UNMAXIMIZE);
|
||||||
}
|
}
|
||||||
@@ -809,15 +774,9 @@ unmapTransientsFor(WWindow *wwin)
|
|||||||
/*
|
/*
|
||||||
if (!tmp->flags.shaded)
|
if (!tmp->flags.shaded)
|
||||||
*/
|
*/
|
||||||
wClientSetState(tmp, IconicState, None);
|
wClientSetState(tmp, IconicState, None);
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
|
WMPostNotificationName(WMNChangedState, tmp, "iconify-transient");
|
||||||
wKWMSendEventMessage(tmp, WKWMRemoveWindow);
|
|
||||||
tmp->flags.kwm_hidden_for_modules = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, tmp, ACTION_CHANGE_STATE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tmp = tmp->prev;
|
tmp = tmp->prev;
|
||||||
}
|
}
|
||||||
@@ -846,17 +805,9 @@ mapTransientsFor(WWindow *wwin)
|
|||||||
/*
|
/*
|
||||||
if (!tmp->flags.shaded)
|
if (!tmp->flags.shaded)
|
||||||
*/
|
*/
|
||||||
wClientSetState(tmp, NormalState, None);
|
wClientSetState(tmp, NormalState, None);
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
|
WMPostNotificationName(WMNChangedState, tmp, "iconify-transient");
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tmp = tmp->prev;
|
tmp = tmp->prev;
|
||||||
}
|
}
|
||||||
@@ -1072,15 +1023,7 @@ wIconifyWindow(WWindow *wwin)
|
|||||||
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
|
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
|
||||||
wIconSelect(wwin->icon);
|
wIconSelect(wwin->icon);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "iconify");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
|
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1193,15 +1136,7 @@ wDeiconifyWindow(WWindow *wwin)
|
|||||||
wArrangeIcons(wwin->screen_ptr, True);
|
wArrangeIcons(wwin->screen_ptr, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "iconify");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag);
|
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1215,12 +1150,8 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
|||||||
wwin->icon->mapped = 0;
|
wwin->icon->mapped = 0;
|
||||||
}
|
}
|
||||||
wwin->flags.hidden = 1;
|
wwin->flags.hidden = 1;
|
||||||
#ifdef GNOME_STUFF
|
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
WMPostNotificationName(WMNChangedState, wwin, "hide");
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1245,11 +1176,7 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
|||||||
#endif
|
#endif
|
||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "hide");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1400,12 +1327,7 @@ unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate,
|
|||||||
wUnhideInspectorForWindow(wwin);
|
wUnhideInspectorForWindow(wwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNChangedState, wwin, "hide");
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1444,7 +1366,7 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
|
|||||||
}
|
}
|
||||||
wlist->flags.hidden = 0;
|
wlist->flags.hidden = 0;
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, wlist, ACTION_CHANGE_STATE);
|
WMPostNotificationName(WMNChangedState, wlist, "hide");
|
||||||
|
|
||||||
if (wlist->frame->workspace != scr->current_workspace)
|
if (wlist->frame->workspace != scr->current_workspace)
|
||||||
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
||||||
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
|
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
|
||||||
newFocused = nextToFocusAfter(newFocused);
|
newFocused = nextToFocusAfter(newFocused);
|
||||||
wWindowFocus(newFocused, oldFocused);
|
wWindowFocus(newFocused, oldFocused);
|
||||||
oldFocused = newFocused;
|
oldFocused = newFocused;
|
||||||
@@ -260,12 +259,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
|
||||||
|
|
||||||
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
|
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
|
||||||
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
|
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
|
||||||
newFocused = nextToFocusBefore(newFocused);
|
newFocused = nextToFocusBefore(newFocused);
|
||||||
wWindowFocus(newFocused, oldFocused);
|
wWindowFocus(newFocused, oldFocused);
|
||||||
oldFocused = newFocused;
|
oldFocused = newFocused;
|
||||||
@@ -275,7 +271,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
CommitStacking(scr);
|
CommitStacking(scr);
|
||||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||||
}
|
}
|
||||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
somethingElse = True;
|
somethingElse = True;
|
||||||
|
|||||||
@@ -594,11 +594,11 @@ static void
|
|||||||
executeButtonAction(WScreen *scr, XEvent *event, int action)
|
executeButtonAction(WScreen *scr, XEvent *event, int action)
|
||||||
{
|
{
|
||||||
switch(action) {
|
switch(action) {
|
||||||
case WA_SELECT_WINDOWS:
|
case WA_SELECT_WINDOWS:
|
||||||
wUnselectWindows(scr);
|
wUnselectWindows(scr);
|
||||||
wSelectWindows(scr, event);
|
wSelectWindows(scr, event);
|
||||||
break;
|
break;
|
||||||
case WA_OPEN_APPMENU:
|
case WA_OPEN_APPMENU:
|
||||||
OpenRootMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
OpenRootMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
||||||
/* ugly hack */
|
/* ugly hack */
|
||||||
if (scr->root_menu) {
|
if (scr->root_menu) {
|
||||||
@@ -608,7 +608,7 @@ executeButtonAction(WScreen *scr, XEvent *event, int action)
|
|||||||
event->xbutton.window = scr->root_menu->frame->core->window;
|
event->xbutton.window = scr->root_menu->frame->core->window;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WA_OPEN_WINLISTMENU:
|
case WA_OPEN_WINLISTMENU:
|
||||||
OpenSwitchMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
OpenSwitchMenu(scr, event->xbutton.x_root, event->xbutton.y_root, False);
|
||||||
if (scr->switch_menu) {
|
if (scr->switch_menu) {
|
||||||
if (scr->switch_menu->brother->flags.mapped)
|
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);
|
OpenRootMenu(scr, scr->scr_width/2, scr->scr_height/2, True);
|
||||||
break;
|
break;
|
||||||
case WKBD_WINDOWLIST:
|
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);
|
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, True);
|
||||||
break;
|
break;
|
||||||
#endif /* !LITE */
|
#endif /* !LITE */
|
||||||
|
|||||||
21
src/funcs.h
21
src/funcs.h
@@ -43,7 +43,10 @@ void SetupEnvironment(WScreen *scr);
|
|||||||
|
|
||||||
void DispatchEvent(XEvent *event);
|
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);
|
Bool wRootMenuPerformShortcut(XEvent *event);
|
||||||
|
|
||||||
@@ -55,6 +58,8 @@ void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
|
|||||||
|
|
||||||
#endif /* !LITE */
|
#endif /* !LITE */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
|
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
|
||||||
|
|
||||||
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
|
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
|
||||||
@@ -63,20 +68,6 @@ void OpenWorkspaceMenu(WScreen *scr, int x, int y);
|
|||||||
|
|
||||||
void CloseWindowMenu(WScreen *scr);
|
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);
|
WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
|
||||||
|
|
||||||
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
|
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
|
||||||
|
|||||||
71
src/gnome.c
71
src/gnome.c
@@ -102,6 +102,10 @@ static Atom _XA_WIN_CLIENT_LIST;
|
|||||||
static Atom _XA_WIN_DESKTOP_BUTTON_PROXY;
|
static Atom _XA_WIN_DESKTOP_BUTTON_PROXY;
|
||||||
|
|
||||||
|
|
||||||
|
static void observer(void *self, WMNotification *notif);
|
||||||
|
static void wsobserver(void *self, WMNotification *notif);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wGNOMEInitStuff(WScreen *scr)
|
wGNOMEInitStuff(WScreen *scr)
|
||||||
{
|
{
|
||||||
@@ -183,6 +187,17 @@ wGNOMEInitStuff(WScreen *scr)
|
|||||||
PropModeReplace, (unsigned char*)supportedStuff, count);
|
PropModeReplace, (unsigned char*)supportedStuff, count);
|
||||||
|
|
||||||
XFlush(dpy);
|
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);
|
XGetWindowAttributes(dpy, wwin->client_win, &wattribs);
|
||||||
wClientGetNormalHints(wwin, &wattribs, False,
|
wClientGetNormalHints(wwin, &wattribs, False,
|
||||||
&area->area.x1, &area->area.y1,
|
&area->area.x1, &area->area.y1,
|
||||||
&area->area.x2, &area->area.y2);
|
&area->area.x2, &area->area.y2);
|
||||||
area->area.x2 = area->area.x2 + area->area.x1;
|
area->area.x2 = area->area.x2 + area->area.x1;
|
||||||
area->area.y2 = area->area.y2 + area->area.y1;
|
area->area.y2 = area->area.y2 + area->area.y1;
|
||||||
|
|
||||||
@@ -521,7 +536,6 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
|||||||
}
|
}
|
||||||
} else if (event->message_type == _XA_WIN_STATE) {
|
} else if (event->message_type == _XA_WIN_STATE) {
|
||||||
int flags, mask;
|
int flags, mask;
|
||||||
Bool updateWindowList = False;
|
|
||||||
int maximize = 0;
|
int maximize = 0;
|
||||||
|
|
||||||
mask = event->data.l[0];
|
mask = event->data.l[0];
|
||||||
@@ -529,9 +543,7 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
|||||||
|
|
||||||
if (mask & WIN_STATE_STICKY) {
|
if (mask & WIN_STATE_STICKY) {
|
||||||
if ((flags & WIN_STATE_STICKY) != WFLAGP(wwin, omnipresent)) {
|
if ((flags & WIN_STATE_STICKY) != WFLAGP(wwin, omnipresent)) {
|
||||||
wwin->client_flags.omnipresent = (flags & WIN_STATE_STICKY)!=0;
|
wWindowSetOmnipresent(wwin, (flags & WIN_STATE_STICKY)!=0);
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
updateWindowList = True;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +573,6 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
|||||||
if ((maximize & both) && !(wwin->flags.maximized & both)) {
|
if ((maximize & both) && !(wwin->flags.maximized & both)) {
|
||||||
wMaximizeWindow(wwin, maximize);
|
wMaximizeWindow(wwin, maximize);
|
||||||
}
|
}
|
||||||
updateWindowList = False;
|
|
||||||
#undef both
|
#undef both
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,13 +582,8 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
|||||||
wUnshadeWindow(wwin);
|
wUnshadeWindow(wwin);
|
||||||
else
|
else
|
||||||
wShadeWindow(wwin);
|
wShadeWindow(wwin);
|
||||||
updateWindowList = False;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateWindowList) {
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
|
||||||
}
|
|
||||||
} else if (event->message_type == _XA_WIN_WORKSPACE) {
|
} else if (event->message_type == _XA_WIN_WORKSPACE) {
|
||||||
|
|
||||||
if (event->data.l[0] != wwin->frame->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 */
|
#endif /* GNOME_STUFF */
|
||||||
|
|||||||
139
src/kwm.c
139
src/kwm.c
@@ -232,6 +232,11 @@ enum {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void observer(void *self, WMNotification *notif);
|
||||||
|
static void wsobserver(void *self, WMNotification *notif);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
getSimpleHint(Window win, Atom atom, long *retval)
|
getSimpleHint(Window win, Atom atom, long *retval)
|
||||||
{
|
{
|
||||||
@@ -637,6 +642,23 @@ wKWMInitStuff(WScreen *scr)
|
|||||||
SETSTR(KWM_STRING_TODESKTOP, _("Move To"));
|
SETSTR(KWM_STRING_TODESKTOP, _("Move To"));
|
||||||
SETSTR(KWM_STRING_ONTOCURRENTDESKTOP, _("Bring Here"));
|
SETSTR(KWM_STRING_ONTOCURRENTDESKTOP, _("Bring Here"));
|
||||||
#undef SETSTR
|
#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) {
|
if (flag != wwin->client_flags.omnipresent) {
|
||||||
|
|
||||||
wwin->client_flags.omnipresent = flag;
|
wWindowSetOmnipresent(wwin, flag);
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (event->atom == _XA_KWM_WIN_MAXIMIZED) {
|
} else if (event->atom == _XA_KWM_WIN_MAXIMIZED) {
|
||||||
int bla = 0;
|
int bla = 0;
|
||||||
@@ -1039,8 +1058,7 @@ performWindowCommand(WScreen *scr, char *command)
|
|||||||
} else if (strcmp(command, "winSticky")==0) {
|
} else if (strcmp(command, "winSticky")==0) {
|
||||||
|
|
||||||
if (wwin) {
|
if (wwin) {
|
||||||
wwin->client_flags.omnipresent ^= 1;
|
wWindowSetOmnipresent(wwin, !wwin->client_flags.omnipresent);
|
||||||
UpdateSwitchMenu(scr, wwin, ACTION_CHANGE_WORKSPACE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (strcmp(command, "winShade")==0) {
|
} else if (strcmp(command, "winShade")==0) {
|
||||||
@@ -1676,7 +1694,7 @@ wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message)
|
|||||||
sendToModules(wwin ? wwin->screen_ptr : NULL, msg, wwin, 0);
|
sendToModules(wwin ? wwin->screen_ptr : NULL, msg, wwin, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
writeSocket(int sock, char *data)
|
writeSocket(int sock, char *data)
|
||||||
{
|
{
|
||||||
@@ -1772,7 +1790,7 @@ connectKFM(WScreen *scr)
|
|||||||
|
|
||||||
return sock;
|
return sock;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control)
|
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 */
|
#endif /* KWM_HINTS */
|
||||||
|
|||||||
17
src/main.c
17
src/main.c
@@ -147,6 +147,23 @@ char WDelayedActionSet = 0;
|
|||||||
int wVisualID = -1;
|
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 *****/
|
/******** End Global Variables *****/
|
||||||
|
|
||||||
static char *DisplayName = NULL;
|
static char *DisplayName = NULL;
|
||||||
|
|||||||
@@ -35,9 +35,7 @@
|
|||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "properties.h"
|
#include "properties.h"
|
||||||
#include "stacking.h"
|
#include "stacking.h"
|
||||||
#ifdef KWM_HINTS
|
|
||||||
#include "kwm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*** Global Variables ***/
|
/*** Global Variables ***/
|
||||||
extern XContext wStackContext;
|
extern XContext wStackContext;
|
||||||
@@ -45,6 +43,14 @@ extern XContext wStackContext;
|
|||||||
extern WPreferences wPreferences;
|
extern WPreferences wPreferences;
|
||||||
|
|
||||||
|
|
||||||
|
static void notifyStackChange(WCoreWindow *frame, char *detail)
|
||||||
|
{
|
||||||
|
WWindow *wwin = wWindowFor(frame->window);
|
||||||
|
|
||||||
|
WMPostNotificationName(WMNChangedStacking, wwin, detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
* RemakeStackList--
|
* RemakeStackList--
|
||||||
@@ -145,11 +151,9 @@ CommitStacking(WScreen *scr)
|
|||||||
}
|
}
|
||||||
XRestackWindows(dpy, windows, i);
|
XRestackWindows(dpy, windows, i);
|
||||||
wfree(windows);
|
wfree(windows);
|
||||||
|
|
||||||
|
|
||||||
#ifdef KWM_HINTS
|
WMPostNotificationName(WMNResetStacking, scr, NULL);
|
||||||
wKWMBroadcastStacking(scr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -172,10 +176,6 @@ moveFrameToUnder(WCoreWindow *under, WCoreWindow *frame)
|
|||||||
wins[0] = under->window;
|
wins[0] = under->window;
|
||||||
wins[1] = frame->window;
|
wins[1] = frame->window;
|
||||||
XRestackWindows(dpy, wins, 2);
|
XRestackWindows(dpy, wins, 2);
|
||||||
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMBroadcastStacking(under->screen_ptr);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -253,18 +253,12 @@ again:
|
|||||||
} else {
|
} else {
|
||||||
moveFrameToUnder(frame->stacking->above, frame);
|
moveFrameToUnder(frame->stacking->above, frame);
|
||||||
}
|
}
|
||||||
#ifdef KWM_HINTS
|
|
||||||
{
|
|
||||||
WWindow *wwin = wWindowFor(frame->window);
|
|
||||||
|
|
||||||
if (wwin != NULL)
|
notifyStackChange(frame, "raise");
|
||||||
wKWMSendEventMessage(wwin, WKWMRaiseWindow);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef VIRTUAL_DESKTOP
|
#ifdef VIRTUAL_DESKTOP
|
||||||
wWorkspaceRaiseEdge(scr);
|
wWorkspaceRaiseEdge(scr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -374,15 +368,8 @@ wLowerFrame(WCoreWindow *frame)
|
|||||||
} else {
|
} else {
|
||||||
moveFrameToUnder(frame->stacking->above, frame);
|
moveFrameToUnder(frame->stacking->above, frame);
|
||||||
}
|
}
|
||||||
#ifdef KWM_HINTS
|
|
||||||
{
|
|
||||||
WWindow *wwin = wWindowFor(frame->window);
|
|
||||||
|
|
||||||
if (wwin)
|
notifyStackChange(frame, "lower");
|
||||||
wKWMSendEventMessage(wwin, WKWMLowerWindow);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -446,8 +433,7 @@ AddToStackList(WCoreWindow *frame)
|
|||||||
curtop->stacking->above = frame;
|
curtop->stacking->above = frame;
|
||||||
WMSetInBag(scr->stacking_list, index, frame);
|
WMSetInBag(scr->stacking_list, index, frame);
|
||||||
}
|
}
|
||||||
CommitStacking(scr);
|
CommitStacking(scr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -516,7 +502,8 @@ MoveInStackListAbove(WCoreWindow *next, WCoreWindow *frame)
|
|||||||
} else {
|
} else {
|
||||||
moveFrameToUnder(frame->stacking->above, frame);
|
moveFrameToUnder(frame->stacking->above, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMPostNotificationName(WMNResetStacking, scr, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -561,6 +548,8 @@ MoveInStackListUnder(WCoreWindow *prev, WCoreWindow *frame)
|
|||||||
frame->stacking->under = prev->stacking->under;
|
frame->stacking->under = prev->stacking->under;
|
||||||
prev->stacking->under = frame;
|
prev->stacking->under = frame;
|
||||||
moveFrameToUnder(prev, frame);
|
moveFrameToUnder(prev, frame);
|
||||||
|
|
||||||
|
WMPostNotificationName(WMNResetStacking, scr, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ extern WPreferences wPreferences;
|
|||||||
extern Time LastTimestamp;
|
extern Time LastTimestamp;
|
||||||
|
|
||||||
|
|
||||||
|
static void observer(void *self, WMNotification *notif);
|
||||||
|
static void wsobserver(void *self, WMNotification *notif);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FocusWindow
|
* FocusWindow
|
||||||
*
|
*
|
||||||
@@ -91,6 +95,22 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
|||||||
{
|
{
|
||||||
WMenu *switchmenu = scr->switch_menu;
|
WMenu *switchmenu = scr->switch_menu;
|
||||||
WWindow *wwin;
|
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) {
|
||||||
if (switchmenu->flags.mapped) {
|
if (switchmenu->flags.mapped) {
|
||||||
@@ -106,6 +126,9 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
|||||||
x-switchmenu->frame->core->width/2, y);
|
x-switchmenu->frame->core->width/2, y);
|
||||||
}
|
}
|
||||||
} else {
|
} 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,
|
wMenuMapAt(switchmenu, x-switchmenu->frame->core->width/2, y,
|
||||||
keyboard);
|
keyboard);
|
||||||
}
|
}
|
||||||
@@ -175,7 +198,7 @@ menuIndexForWindow(WMenu *menu, WWindow *wwin, int old_pos)
|
|||||||
/*
|
/*
|
||||||
* Update switch menu
|
* Update switch menu
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
|
UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
|
||||||
{
|
{
|
||||||
WMenu *switchmenu = scr->switch_menu;
|
WMenu *switchmenu = scr->switch_menu;
|
||||||
@@ -278,7 +301,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
|
|||||||
int idx = -1;
|
int idx = -1;
|
||||||
char *t, *rt;
|
char *t, *rt;
|
||||||
int it, ion;
|
int it, ion;
|
||||||
|
|
||||||
if (IS_OMNIPRESENT(wwin)) {
|
if (IS_OMNIPRESENT(wwin)) {
|
||||||
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
|
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
|
||||||
"[*]");
|
"[*]");
|
||||||
@@ -367,7 +390,7 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
|
|||||||
if (IS_OMNIPRESENT(wwin))
|
if (IS_OMNIPRESENT(wwin))
|
||||||
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[*]");
|
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[*]");
|
||||||
else
|
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);
|
scr->workspaces[wwin->frame->workspace]->name);
|
||||||
menu->flags.realized = 0;
|
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 */
|
#endif /* !LITE */
|
||||||
|
|||||||
91
src/window.c
91
src/window.c
@@ -96,6 +96,7 @@ extern Time LastTimestamp;
|
|||||||
extern void DoWindowBirth(WWindow*);
|
extern void DoWindowBirth(WWindow*);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***** Local Stuff *****/
|
/***** Local Stuff *****/
|
||||||
|
|
||||||
|
|
||||||
@@ -1215,16 +1216,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
/* Update name must come after WApplication stuff is done */
|
/* Update name must come after WApplication stuff is done */
|
||||||
wWindowUpdateName(wwin, title);
|
wWindowUpdateName(wwin, title);
|
||||||
if (title)
|
if (title)
|
||||||
XFree(title);
|
XFree(title);
|
||||||
|
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
|
||||||
wGNOMEUpdateClientStateHint(wwin, True);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateClientWorkspace(wwin);
|
|
||||||
wKWMUpdateClientStateHint(wwin, KWMAllFlags);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
|
|
||||||
@@ -1250,19 +1242,14 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
if (!WFLAGP(wwin, no_bind_keys)) {
|
if (!WFLAGP(wwin, no_bind_keys)) {
|
||||||
wWindowSetKeyGrabs(wwin);
|
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);
|
wColormapInstallForWindow(scr, scr->cmap_window);
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, wwin, ACTION_ADD);
|
|
||||||
|
|
||||||
#ifdef OLWM_HINTS
|
#ifdef OLWM_HINTS
|
||||||
if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL
|
if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL
|
||||||
&& !WFLAGP(wwin, no_close_button) && !withdraw) {
|
&& !WFLAGP(wwin, no_close_button) && !withdraw) {
|
||||||
@@ -1448,8 +1435,6 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
|||||||
|
|
||||||
wWindowSetKeyGrabs(wwin);
|
wWindowSetKeyGrabs(wwin);
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
|
|
||||||
|
|
||||||
return wwin;
|
return wwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1477,12 +1462,6 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
|
|
||||||
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wwin->frame->workspace = -1;
|
|
||||||
|
|
||||||
wKWMUpdateClientWorkspace(wwin);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* First close attribute editor window if open */
|
/* First close attribute editor window if open */
|
||||||
if (wwin->flags.inspector_open) {
|
if (wwin->flags.inspector_open) {
|
||||||
wCloseInspectorForWindow(wwin);
|
wCloseInspectorForWindow(wwin);
|
||||||
@@ -1517,8 +1496,6 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
|
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
|
|
||||||
UpdateSwitchMenu(scr, wwin, ACTION_REMOVE);
|
|
||||||
|
|
||||||
/* reparent the window back to the root */
|
/* reparent the window back to the root */
|
||||||
if (restore)
|
if (restore)
|
||||||
wClientRestore(wwin);
|
wClientRestore(wwin);
|
||||||
@@ -1609,12 +1586,7 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!wwin->flags.internal_window) {
|
if (!wwin->flags.internal_window) {
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNUnmanaged, wwin, NULL);
|
||||||
wGNOMERemoveClient(wwin);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMSendEventMessage(wwin, WKWMRemoveWindow);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -1681,13 +1653,13 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
|
|||||||
wwin->flags.semi_focused = 0;
|
wwin->flags.semi_focused = 0;
|
||||||
|
|
||||||
if (wwin->flags.is_gnustep == 0)
|
if (wwin->flags.is_gnustep == 0)
|
||||||
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
||||||
|
|
||||||
wwin->flags.focused = 1;
|
wwin->flags.focused = 1;
|
||||||
|
|
||||||
wWindowResetMouseGrabs(wwin);
|
wWindowResetMouseGrabs(wwin);
|
||||||
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
WMPostNotificationName(WMNChangedFocus, wwin, (void*)True);
|
||||||
|
|
||||||
if (owin == wwin || !owin)
|
if (owin == wwin || !owin)
|
||||||
return;
|
return;
|
||||||
@@ -1737,8 +1709,8 @@ wWindowUnfocus(WWindow *wwin)
|
|||||||
CloseWindowMenu(wwin->screen_ptr);
|
CloseWindowMenu(wwin->screen_ptr);
|
||||||
|
|
||||||
if (wwin->flags.is_gnustep == 0)
|
if (wwin->flags.is_gnustep == 0)
|
||||||
wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused
|
wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused
|
||||||
? WS_PFOCUSED : WS_UNFOCUSED);
|
? WS_PFOCUSED : WS_UNFOCUSED);
|
||||||
|
|
||||||
if (wwin->transient_for!=None
|
if (wwin->transient_for!=None
|
||||||
&& wwin->transient_for!=wwin->screen_ptr->root_win) {
|
&& wwin->transient_for!=wwin->screen_ptr->root_win) {
|
||||||
@@ -1756,8 +1728,7 @@ wWindowUnfocus(WWindow *wwin)
|
|||||||
|
|
||||||
wWindowResetMouseGrabs(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);
|
WApplication *app = wApplicationOf(wwin->main_window);
|
||||||
int instIndex = 0;
|
int instIndex = 0;
|
||||||
Bool res;
|
|
||||||
char prefix[32] = "";
|
char prefix[32] = "";
|
||||||
char *tmp, *title;
|
char *title;
|
||||||
|
|
||||||
if (!wwin->frame)
|
if (!wwin->frame)
|
||||||
return;
|
return;
|
||||||
@@ -1782,10 +1752,8 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
|
|||||||
if (!newTitle) {
|
if (!newTitle) {
|
||||||
/* the hint was removed */
|
/* the hint was removed */
|
||||||
title = DEF_WINDOW_TITLE;
|
title = DEF_WINDOW_TITLE;
|
||||||
|
|
||||||
#ifdef KWM_HINTS
|
WMPostNotificationName(WMNChangedName, wwin, NULL);
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
title = newTitle;
|
title = newTitle;
|
||||||
}
|
}
|
||||||
@@ -1799,11 +1767,8 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wFrameWindowChangeTitle(wwin->frame, title)) {
|
if (wFrameWindowChangeTitle(wwin->frame, title)) {
|
||||||
/* only update the menu if the title has actually changed */
|
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE);
|
WMPostNotificationName(WMNChangedName, wwin, NULL);
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_WINDOW_ENUMERATOR
|
#ifndef NO_WINDOW_ENUMERATOR
|
||||||
@@ -1996,16 +1961,13 @@ wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!IS_OMNIPRESENT(wwin)) {
|
if (!IS_OMNIPRESENT(wwin)) {
|
||||||
|
int oldWorkspace = wwin->frame->workspace;
|
||||||
|
|
||||||
wwin->frame->workspace = 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) {
|
if (unmap) {
|
||||||
wWindowUnmap(wwin);
|
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
|
static void
|
||||||
|
|||||||
@@ -401,4 +401,6 @@ void wWindowDeleteSavedState(WMagicNumber id);
|
|||||||
|
|
||||||
Bool wWindowObscuresWindow(WWindow *wwin, WWindow *obscured);
|
Bool wWindowObscuresWindow(WWindow *wwin, WWindow *obscured);
|
||||||
|
|
||||||
|
void wWindowSetOmnipresent(WWindow *wwin, Bool flag);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -98,11 +98,7 @@ execWindowOptionCommand(WMenu *menu, WMenuEntry *entry)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WO_OMNIPRESENT:
|
case WO_OMNIPRESENT:
|
||||||
wwin->flags.omnipresent^=1;
|
wWindowSetOmnipresent(wwin, !wwin->flags.omnipresent);
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
|
||||||
#ifdef GNOME_STUFF
|
|
||||||
wGNOMEUpdateClientStateHint(wwin, False);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "dock.h"
|
#include "dock.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
|
|
||||||
#include <proplist.h>
|
#include <proplist.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -876,7 +877,7 @@ applySettings(WMButton *button, InspectorPanel *panel)
|
|||||||
skip_window_list ? ACTION_REMOVE : ACTION_ADD);
|
skip_window_list ? ACTION_REMOVE : ACTION_ADD);
|
||||||
} else {
|
} else {
|
||||||
if (WFLAGP(wwin, omnipresent) != old_omnipresent) {
|
if (WFLAGP(wwin, omnipresent) != old_omnipresent) {
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
WMPostNotificationName(WMNChangedState, wwin, "omnipresent");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* 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.
|
* USA.
|
||||||
*/
|
*/
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
@@ -46,9 +46,6 @@
|
|||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "appicon.h"
|
#include "appicon.h"
|
||||||
#ifdef GNOME_STUFF
|
|
||||||
#include "gnome.h"
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
#ifdef KWM_HINTS
|
||||||
#include "kwm.h"
|
#include "kwm.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -134,18 +131,8 @@ wWorkspaceNew(WScreen *scr)
|
|||||||
wspace->height = scr->scr_height;
|
wspace->height = scr->scr_height;
|
||||||
wspace->width = scr->scr_width;
|
wspace->width = scr->scr_width;
|
||||||
#endif
|
#endif
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNWorkspaceCreated, scr,
|
||||||
wGNOMEUpdateWorkspaceHints(scr);
|
(void*)(scr->workspace_count-1));
|
||||||
#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
|
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
|
|
||||||
return scr->workspace_count-1;
|
return scr->workspace_count-1;
|
||||||
@@ -220,12 +207,8 @@ wWorkspaceDelete(WScreen *scr, int workspace)
|
|||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNWorkspaceDestroyed, scr,
|
||||||
wGNOMEUpdateWorkspaceHints(scr);
|
(void*)(scr->workspace_count-1));
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateWorkspaceCountHint(scr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (scr->current_workspace >= scr->workspace_count)
|
if (scr->current_workspace >= scr->workspace_count)
|
||||||
wWorkspaceChange(scr, scr->workspace_count-1);
|
wWorkspaceChange(scr, scr->workspace_count-1);
|
||||||
@@ -622,12 +605,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
|
|
||||||
showWorkspaceName(scr, workspace);
|
showWorkspaceName(scr, workspace);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)workspace);
|
||||||
wGNOMEUpdateCurrentWorkspaceHint(scr);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateCurrentWorkspaceHint(scr);
|
|
||||||
#endif
|
|
||||||
/* XSync(dpy, False); */
|
/* XSync(dpy, False); */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -919,17 +898,10 @@ wWorkspaceRename(WScreen *scr, int workspace, char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSwitchMenuWorkspace(scr, workspace);
|
|
||||||
|
|
||||||
if (scr->clip_icon)
|
if (scr->clip_icon)
|
||||||
wClipIconPaint(scr->clip_icon);
|
wClipIconPaint(scr->clip_icon);
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)workspace);
|
||||||
wGNOMEUpdateWorkspaceNamesHint(scr);
|
|
||||||
#endif
|
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateWorkspaceNameHint(scr, workspace);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1112,13 +1084,9 @@ wWorkspaceRestoreState(WScreen *scr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef KWM_HINTS
|
|
||||||
wKWMUpdateWorkspaceNameHint(scr, i);
|
WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)i);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef GNOME_STUFF
|
|
||||||
wGNOMEUpdateWorkspaceNamesHint(scr);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user