mirror of
https://github.com/gryf/wmaker.git
synced 2026-06-10 12:15:25 +02:00
Update for 0.51.0
This commit is contained in:
+1
-9
@@ -1,5 +1,3 @@
|
||||
nlsdir = @NLSDIR@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
BUILT_SOURCES = wconfig.h
|
||||
@@ -100,13 +98,7 @@ wmaker_SOURCES = \
|
||||
text.h
|
||||
|
||||
|
||||
CPPFLAGS = \
|
||||
@CPPFLAGS@ \
|
||||
@SHAPE@ @I18N@ @X_LOCALE@ @LITE@ \
|
||||
@DFLAGS@ \
|
||||
-DNLSDIR="\"$(nlsdir)\"" \
|
||||
-DPKGDATADIR="\"$(pkgdatadir)\"" \
|
||||
-DPIXMAPDIR="\"$(pixmapdir)\""
|
||||
CPPFLAGS = @CPPFLAGS@ @DFLAGS@
|
||||
|
||||
|
||||
INCLUDES = \
|
||||
|
||||
+1
-17
@@ -65,8 +65,6 @@ DFLAGS = @DFLAGS@
|
||||
GFXFLAGS = @GFXFLAGS@
|
||||
GFXLFLAGS = @GFXLFLAGS@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
I18N = @I18N@
|
||||
I18N_MB = @I18N_MB@
|
||||
ICONEXT = @ICONEXT@
|
||||
INTLIBS = @INTLIBS@
|
||||
LD = @LD@
|
||||
@@ -79,23 +77,15 @@ NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
REDUCE_APPICONS = @REDUCE_APPICONS@
|
||||
SHAPE = @SHAPE@
|
||||
SOUND = @SOUND@
|
||||
VERSION = @VERSION@
|
||||
WPMOFILES = @WPMOFILES@
|
||||
XCFLAGS = @XCFLAGS@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XLFLAGS = @XLFLAGS@
|
||||
XLIBS = @XLIBS@
|
||||
XSHM = @XSHM@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LOCALE = @X_LOCALE@
|
||||
pixmapdir = @pixmapdir@
|
||||
wprefsdir = @wprefsdir@
|
||||
|
||||
nlsdir = @NLSDIR@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
BUILT_SOURCES = wconfig.h
|
||||
@@ -195,13 +185,7 @@ wmaker_SOURCES = \
|
||||
text.c \
|
||||
text.h
|
||||
|
||||
CPPFLAGS = \
|
||||
@CPPFLAGS@ \
|
||||
@SHAPE@ @I18N@ @X_LOCALE@ @LITE@ \
|
||||
@DFLAGS@ \
|
||||
-DNLSDIR="\"$(nlsdir)\"" \
|
||||
-DPKGDATADIR="\"$(pkgdatadir)\"" \
|
||||
-DPIXMAPDIR="\"$(pixmapdir)\""
|
||||
CPPFLAGS = @CPPFLAGS@ @DFLAGS@
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/libPropList \
|
||||
|
||||
+12
-2
@@ -173,6 +173,12 @@ typedef enum {
|
||||
#define WS_FOCUSED 0
|
||||
#define WS_UNFOCUSED 1
|
||||
#define WS_PFOCUSED 2
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
#define WS_SMENU 3
|
||||
#define WS_SFOCUSED 3
|
||||
#define WS_SUNFOCUSED 4
|
||||
#define WS_SPFOCUSED 5
|
||||
#endif /* TITLE_TEXT_SHADOW */
|
||||
|
||||
/* clip title colors */
|
||||
#define CLIP_NORMAL 0
|
||||
@@ -240,10 +246,14 @@ typedef struct WPreferences {
|
||||
|
||||
char ignore_focus_click;
|
||||
|
||||
char on_top_transients; /* transient windows are kept on top
|
||||
* of their owners */
|
||||
char open_transients_with_parent; /* open transient window in
|
||||
same workspace as parent */
|
||||
char title_justification; /* titlebar text alignment */
|
||||
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
char title_shadow;
|
||||
#endif
|
||||
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
char modelock;
|
||||
#endif
|
||||
|
||||
+47
-59
@@ -20,8 +20,6 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#define HACK
|
||||
|
||||
#include "wconfig.h"
|
||||
|
||||
|
||||
@@ -117,6 +115,7 @@ processEvents(int event_count)
|
||||
#endif /* ANIMATIONS */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wSetFocusTo--
|
||||
@@ -141,9 +140,12 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
|
||||
LastFocusChange = timestamp;
|
||||
|
||||
#ifndef HACK
|
||||
/*
|
||||
* This is a hack, because XSetInputFocus() should have a proper
|
||||
* timestamp instead of CurrentTime but it seems that some times
|
||||
* clients will not receive focus properly that way.
|
||||
if (ignoreTimestamp)
|
||||
#endif
|
||||
*/
|
||||
timestamp = CurrentTime;
|
||||
|
||||
if (focused)
|
||||
@@ -310,20 +312,19 @@ wShadeWindow(WWindow *wwin)
|
||||
}
|
||||
#endif /* ANIMATIONS */
|
||||
|
||||
|
||||
wwin->flags.skip_next_animation = 0;
|
||||
XGetWindowAttributes(dpy, wwin->client_win, &attribs);
|
||||
wwin->flags.shaded=1;
|
||||
wwin->flags.shaded = 1;
|
||||
wwin->flags.mapped=0;
|
||||
XGetWindowAttributes(dpy, wwin->client_win, &attribs);
|
||||
/* prevent window withdrawal when getting UnmapNotify */
|
||||
XSelectInput(dpy, wwin->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, wwin->client_win);
|
||||
XSelectInput(dpy, wwin->client_win, attribs.your_event_mask);
|
||||
|
||||
|
||||
/* for the client it's just like iconification */
|
||||
wFrameWindowResize(wwin->frame, wwin->frame->core->width,
|
||||
wwin->frame->top_width-1);
|
||||
wwin->frame->top_width - 1);
|
||||
|
||||
wwin->client.y = wwin->frame_y - wwin->client.height
|
||||
+ wwin->frame->top_width;
|
||||
@@ -365,8 +366,8 @@ wUnshadeWindow(WWindow *wwin)
|
||||
if (!wwin->flags.shaded)
|
||||
return;
|
||||
|
||||
wwin->flags.shaded=0;
|
||||
wwin->flags.mapped=1;
|
||||
wwin->flags.shaded = 0;
|
||||
wwin->flags.mapped = 1;
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
|
||||
#ifdef WMSOUND
|
||||
@@ -781,14 +782,13 @@ unmapTransientsFor(WWindow *wwin)
|
||||
XGetWindowAttributes(dpy, tmp->client_win, &attribs);
|
||||
tmp->flags.miniaturized=1;
|
||||
if (!tmp->flags.shaded) {
|
||||
tmp->flags.mapped=0;
|
||||
XSelectInput(dpy, tmp->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, tmp->client_win);
|
||||
XSelectInput(dpy, tmp->client_win, attribs.your_event_mask);
|
||||
wWindowUnmap(tmp);
|
||||
} else {
|
||||
XUnmapWindow(dpy, tmp->frame->core->window);
|
||||
}
|
||||
XUnmapWindow(dpy, tmp->frame->core->window);
|
||||
/*
|
||||
if (!tmp->flags.shaded)
|
||||
*/
|
||||
wClientSetState(tmp, IconicState, None);
|
||||
#ifdef KWM_HINTS
|
||||
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
|
||||
@@ -816,14 +816,16 @@ mapTransientsFor(WWindow *wwin)
|
||||
&& /*!tmp->flags.mapped*/ tmp->flags.miniaturized
|
||||
&& tmp->icon==NULL) {
|
||||
mapTransientsFor(tmp);
|
||||
tmp->flags.miniaturized=0;
|
||||
tmp->flags.miniaturized = 0;
|
||||
if (!tmp->flags.shaded) {
|
||||
tmp->flags.mapped=1;
|
||||
XMapWindow(dpy, tmp->client_win);
|
||||
wWindowMap(tmp);
|
||||
} else {
|
||||
XMapWindow(dpy, tmp->frame->core->window);
|
||||
}
|
||||
XMapWindow(dpy, tmp->frame->core->window);
|
||||
tmp->flags.semi_focused = 0;
|
||||
/*
|
||||
if (!tmp->flags.shaded)
|
||||
*/
|
||||
wClientSetState(tmp, NormalState, None);
|
||||
#ifdef KWM_HINTS
|
||||
wKWMUpdateClientStateHint(tmp, KWMIconifiedFlag);
|
||||
@@ -903,8 +905,10 @@ wIconifyWindow(WWindow *wwin)
|
||||
return;
|
||||
}
|
||||
|
||||
if (wwin->flags.miniaturized)
|
||||
if (wwin->flags.miniaturized) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (wwin->transient_for!=None) {
|
||||
WWindow *owner = wWindowFor(wwin->transient_for);
|
||||
@@ -941,12 +945,7 @@ wIconifyWindow(WWindow *wwin)
|
||||
#endif
|
||||
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
/* prevent window withdrawal when getting UnmapNotify */
|
||||
XSelectInput(dpy, wwin->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, wwin->client_win);
|
||||
XSelectInput(dpy, wwin->client_win, attribs.your_event_mask);
|
||||
XUnmapWindow(dpy, wwin->frame->core->window);
|
||||
wWindowUnmap(wwin);
|
||||
/* let all Expose events arrive so that we can repaint
|
||||
* something before the animation starts (and the server is grabbed) */
|
||||
XSync(dpy, 0);
|
||||
@@ -975,7 +974,12 @@ wIconifyWindow(WWindow *wwin)
|
||||
|
||||
if (present) {
|
||||
WWindow *owner = recursiveTransientFor(wwin->screen_ptr->focused_window);
|
||||
setupIconGrabs(wwin->icon);
|
||||
|
||||
/*
|
||||
* It doesn't seem to be working and causes button event hangup
|
||||
* when deiconifying a transient window.
|
||||
setupIconGrabs(wwin->icon);
|
||||
*/
|
||||
if ((wwin->flags.focused
|
||||
|| (owner && wwin->client_win == owner->client_win))
|
||||
&& wPreferences.focus_mode==WKF_CLICK) {
|
||||
@@ -1034,15 +1038,18 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
|
||||
if (wwin->transient_for != None) {
|
||||
WWindow *owner = recursiveTransientFor(wwin);
|
||||
wDeiconifyWindow(owner);
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
return;
|
||||
|
||||
if (wwin->flags.miniaturized) {
|
||||
wDeiconifyWindow(owner);
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wwin->flags.miniaturized=0;
|
||||
wwin->flags.miniaturized = 0;
|
||||
if (!wwin->flags.shaded)
|
||||
wwin->flags.mapped=1;
|
||||
wwin->flags.mapped = 1;
|
||||
|
||||
if (wwin->icon->selected)
|
||||
wIconSelect(wwin->icon);
|
||||
@@ -1076,7 +1083,7 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
}
|
||||
mapTransientsFor(wwin);
|
||||
RemoveFromStackList(wwin->icon->core);
|
||||
removeIconGrabs(wwin->icon);
|
||||
/* removeIconGrabs(wwin->icon);*/
|
||||
wIconDestroy(wwin->icon);
|
||||
wwin->icon = NULL;
|
||||
|
||||
@@ -1117,9 +1124,6 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
static void
|
||||
hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
||||
{
|
||||
XWindowAttributes attribs;
|
||||
|
||||
|
||||
if (wwin->flags.miniaturized) {
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
wwin->flags.hidden = 1;
|
||||
@@ -1136,31 +1140,15 @@ hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
|
||||
if (wwin->flags.inspector_open) {
|
||||
WWindow *pwin = wwin->inspector->frame;
|
||||
|
||||
XGetWindowAttributes(dpy, pwin->client_win, &attribs);
|
||||
wWindowUnmap(pwin);
|
||||
pwin->flags.hidden = 1;
|
||||
pwin->flags.mapped = 0;
|
||||
/* prevent window withdrawal when getting UnmapNotify */
|
||||
XSelectInput(dpy, pwin->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, pwin->client_win);
|
||||
XSelectInput(dpy, pwin->client_win, attribs.your_event_mask);
|
||||
|
||||
XUnmapWindow(dpy, pwin->frame->core->window);
|
||||
wClientSetState(pwin, IconicState, icon->icon_win);
|
||||
}
|
||||
|
||||
XGetWindowAttributes(dpy, wwin->client_win, &attribs);
|
||||
|
||||
wwin->flags.hidden = 1;
|
||||
wwin->flags.mapped = 0;
|
||||
|
||||
/* prevent window withdrawal when getting UnmapNotify */
|
||||
XSelectInput(dpy, wwin->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, wwin->client_win);
|
||||
XSelectInput(dpy, wwin->client_win, attribs.your_event_mask);
|
||||
|
||||
XUnmapWindow(dpy, wwin->frame->core->window);
|
||||
wWindowUnmap(wwin);
|
||||
|
||||
wClientSetState(wwin, IconicState, icon->icon_win);
|
||||
flushExpose();
|
||||
#ifdef WMSOUND
|
||||
|
||||
+1
-1
@@ -498,7 +498,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
|
||||
|
||||
wretain(icon);
|
||||
|
||||
result = wIconChooserDialog(scr, &file);
|
||||
result = wIconChooserDialog(scr, &file, icon->wm_instance, icon->wm_class);
|
||||
|
||||
if (result && !icon->destroyed) {
|
||||
if (file[0]==0) {
|
||||
|
||||
+5
-2
@@ -398,11 +398,14 @@ wBalloonInitialize(WScreen *scr)
|
||||
|
||||
scr->balloon = bal;
|
||||
|
||||
vmask = CWSaveUnder|CWOverrideRedirect|CWColormap;
|
||||
vmask = CWSaveUnder|CWOverrideRedirect|CWColormap|CWBackPixel
|
||||
|CWBorderPixel;
|
||||
attribs.save_under = True;
|
||||
attribs.override_redirect = True;
|
||||
attribs.colormap = scr->w_colormap;
|
||||
|
||||
attribs.background_pixel = scr->icon_back_texture->normal.pixel;
|
||||
attribs.border_pixel = 0; /* do not care */
|
||||
|
||||
bal->window = XCreateWindow(dpy, scr->root_win, 1, 1, 10, 10, 1,
|
||||
scr->w_depth, CopyFromParent,
|
||||
scr->w_visual, vmask, &attribs);
|
||||
|
||||
+4
-2
@@ -95,8 +95,10 @@ wClientRestore(WWindow *wwin)
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
|
||||
/* don't let the window get iconified after restart */
|
||||
/*
|
||||
if (wwin->flags.shaded)
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -356,7 +358,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
WApplication *wapp = wApplicationOf(wwin->main_window);
|
||||
char **argv;
|
||||
int argc;
|
||||
|
||||
|
||||
if (wapp && wapp->app_icon) {
|
||||
if (wapp->app_icon->command!=NULL)
|
||||
free(wapp->app_icon->command);
|
||||
|
||||
+70
-4
@@ -62,11 +62,15 @@
|
||||
/* define to the path to cpp */
|
||||
#define CPP_PATH "/lib/cpp"
|
||||
|
||||
/* define to the directory containing NLS information
|
||||
* set by configure */
|
||||
#define NLSDIR "/usr/local/lib/locale"
|
||||
|
||||
/* package name */
|
||||
#define PACKAGE "WindowMaker"
|
||||
|
||||
/* package version */
|
||||
#define VERSION "0.50.0"
|
||||
#define VERSION "0.51.0"
|
||||
|
||||
/* define if you want GNOME stuff support */
|
||||
/* #undef GNOME_STUFF */
|
||||
@@ -74,12 +78,74 @@
|
||||
/* define if you want KDE hint support */
|
||||
/* #undef KWM_HINTS */
|
||||
|
||||
/* define if you want OPEN LOOK(tm) hint support */
|
||||
/* #undef OLWM_HINTS */
|
||||
|
||||
/* define if XPM libraries are available
|
||||
* set by configure */
|
||||
#define USE_XPM 1
|
||||
|
||||
/* define if PNG libraries are available
|
||||
* set by configure */
|
||||
#define USE_PNG 1
|
||||
|
||||
/* define if JPEG libraries are available
|
||||
* set by configure */
|
||||
#define USE_JPEG 1
|
||||
|
||||
/* define if GIF libraries are available
|
||||
* set by configure */
|
||||
#define USE_GIF 1
|
||||
|
||||
/* define if TIFF libraries are available
|
||||
* set by configure */
|
||||
#define USE_TIFF 1
|
||||
|
||||
/* define if X's shared memory extension is available
|
||||
* set by configure */
|
||||
#define XSHM 1
|
||||
|
||||
/* define an extra path for pixmaps
|
||||
* set by configure */
|
||||
#define PIXMAPDIR "/usr/local/share/pixmaps"
|
||||
|
||||
/*
|
||||
* define REDUCE_APPICONS if you want apps with the same WM_INSTANCE &&
|
||||
* WM_CLASS to share an appicon
|
||||
*/
|
||||
/* #undef REDUCE_APPICONS */
|
||||
|
||||
/* Internationalization (I18N) support
|
||||
* set by configure */
|
||||
/* #undef I18N */
|
||||
|
||||
/* Multi-byte (japanese, korean, chinese etc.) character support */
|
||||
/* #undef I18N_MB */
|
||||
|
||||
/* define if you want sound support */
|
||||
#define WMSOUND 1
|
||||
|
||||
/* define if you want the 'lite' version */
|
||||
/* #undef LITE */
|
||||
|
||||
/* define if you want support for shaped windows
|
||||
* set by configure */
|
||||
#define SHAPE 1
|
||||
|
||||
/* define if you want support for X window's X_LOCALE
|
||||
* set by configure */
|
||||
#define X_LOCALE 1
|
||||
|
||||
/* the place where the configuration is stored
|
||||
* defined by configure */
|
||||
#define PKGDATADIR "/usr/local/share/WindowMaker"
|
||||
|
||||
/* Define if you have the atexit function. */
|
||||
#define HAVE_ATEXIT 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
|
||||
+69
-3
@@ -61,6 +61,10 @@
|
||||
/* define to the path to cpp */
|
||||
#undef CPP_PATH
|
||||
|
||||
/* define to the directory containing NLS information
|
||||
* set by configure */
|
||||
#undef NLSDIR
|
||||
|
||||
/* package name */
|
||||
#undef PACKAGE
|
||||
|
||||
@@ -73,12 +77,74 @@
|
||||
/* define if you want KDE hint support */
|
||||
#undef KWM_HINTS
|
||||
|
||||
/* define if you want OPEN LOOK(tm) hint support */
|
||||
#undef OLWM_HINTS
|
||||
|
||||
/* define if XPM libraries are available
|
||||
* set by configure */
|
||||
#undef USE_XPM
|
||||
|
||||
/* define if PNG libraries are available
|
||||
* set by configure */
|
||||
#undef USE_PNG
|
||||
|
||||
/* define if JPEG libraries are available
|
||||
* set by configure */
|
||||
#undef USE_JPEG
|
||||
|
||||
/* define if GIF libraries are available
|
||||
* set by configure */
|
||||
#undef USE_GIF
|
||||
|
||||
/* define if TIFF libraries are available
|
||||
* set by configure */
|
||||
#undef USE_TIFF
|
||||
|
||||
/* define if X's shared memory extension is available
|
||||
* set by configure */
|
||||
#undef XSHM
|
||||
|
||||
/* define an extra path for pixmaps
|
||||
* set by configure */
|
||||
#undef PIXMAPDIR
|
||||
|
||||
/*
|
||||
* define REDUCE_APPICONS if you want apps with the same WM_INSTANCE &&
|
||||
* WM_CLASS to share an appicon
|
||||
*/
|
||||
#undef REDUCE_APPICONS
|
||||
|
||||
/* Internationalization (I18N) support
|
||||
* set by configure */
|
||||
#undef I18N
|
||||
|
||||
/* Multi-byte (japanese, korean, chinese etc.) character support */
|
||||
#undef I18N_MB
|
||||
|
||||
/* define if you want sound support */
|
||||
#undef WMSOUND
|
||||
|
||||
/* define if you want the 'lite' version */
|
||||
#undef LITE
|
||||
|
||||
/* define if you want support for shaped windows
|
||||
* set by configure */
|
||||
#undef SHAPE
|
||||
|
||||
/* define if you want support for X window's X_LOCALE
|
||||
* set by configure */
|
||||
#undef X_LOCALE
|
||||
|
||||
/* the place where the configuration is stored
|
||||
* defined by configure */
|
||||
#undef PKGDATADIR
|
||||
|
||||
/* Define if you have the atexit function. */
|
||||
#undef HAVE_ATEXIT
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#undef HAVE_GETHOSTNAME
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
#undef HAVE_POLL
|
||||
|
||||
|
||||
+62
-25
@@ -370,8 +370,8 @@ WDefaultEntry optionList[] = {
|
||||
{"AlignSubmenus", "NO", NULL,
|
||||
&wPreferences.align_menus, getBool, NULL
|
||||
},
|
||||
{"OnTopTransients", "NO", NULL,
|
||||
&wPreferences.on_top_transients, getBool, NULL
|
||||
{"OpenTransientOnOwnerWorkspace", "NO", NULL,
|
||||
&wPreferences.open_transients_with_parent, getBool, NULL
|
||||
},
|
||||
{"WindowPlacement", "auto", sePlacements,
|
||||
&wPreferences.window_placement, getEnum, NULL
|
||||
@@ -632,9 +632,9 @@ WDefaultEntry optionList[] = {
|
||||
},
|
||||
{"WindowShortcut4Key","None", (void*)WKBD_WINDOW4,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
}
|
||||
#ifdef EXTEND_WINDOWSHORTCUT
|
||||
{"WindowShortcut5Key","None", (void*)WKBD_WINDOW5,
|
||||
,{"WindowShortcut5Key","None", (void*)WKBD_WINDOW5,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
{"WindowShortcut6Key","None", (void*)WKBD_WINDOW6,
|
||||
@@ -651,17 +651,34 @@ WDefaultEntry optionList[] = {
|
||||
},
|
||||
{"WindowShortcut10Key","None", (void*)WKBD_WINDOW10,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
}
|
||||
#endif /* EXTEND_WINDOWSHORTCUT */
|
||||
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE,
|
||||
,{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
{"KbdModeLock", "NO", NULL,
|
||||
&wPreferences.modelock, getBool, NULL
|
||||
}
|
||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
,{"FShadowColor", "black", (void*)WS_SFOCUSED,
|
||||
NULL, getColor, setWTitleColor
|
||||
},
|
||||
{"PShadowColor", "black", (void*)WS_SPFOCUSED,
|
||||
NULL, getColor, setWTitleColor
|
||||
},
|
||||
{"UShadowColor", "grey50", (void*)WS_SUNFOCUSED,
|
||||
NULL, getColor, setWTitleColor
|
||||
},
|
||||
{"MShadowColor", "black", (void*)WS_SMENU,
|
||||
NULL, getColor, setMenuTitleColor
|
||||
},
|
||||
{"Shadow", "Yes", NULL,
|
||||
&wPreferences.title_shadow, getBool, setJustify
|
||||
}
|
||||
#endif /* TITLE_TEXT_SHADOW */
|
||||
};
|
||||
|
||||
|
||||
@@ -1550,7 +1567,7 @@ static int
|
||||
getEnum(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
|
||||
void **ret)
|
||||
{
|
||||
static char data;
|
||||
static signed char data;
|
||||
|
||||
data = string2index(entry->plkey, value, entry->default_value,
|
||||
(WOptionEnumeration*)entry->extra_data);
|
||||
@@ -1561,7 +1578,7 @@ getEnum(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
|
||||
*ret = &data;
|
||||
|
||||
if (addr)
|
||||
*(char*)addr = data;
|
||||
*(signed char*)addr = data;
|
||||
|
||||
return True;
|
||||
}
|
||||
@@ -1615,7 +1632,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
return NULL;
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &color)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &color)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1647,7 +1664,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
return NULL;
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &xcolor)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1663,7 +1680,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &xcolor)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1709,7 +1726,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &color)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &color)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
for (--i; i>=0; --i) {
|
||||
free(colors[i]);
|
||||
@@ -1749,7 +1766,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &color)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &color)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1787,7 +1804,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
return NULL;
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &xcolor)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1803,7 +1820,7 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (!XParseColor(dpy, scr->colormap, val, &xcolor)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {
|
||||
wwarning(_("\"%s\" is not a valid color name"), val);
|
||||
return NULL;
|
||||
}
|
||||
@@ -2441,15 +2458,31 @@ setWTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
|
||||
|
||||
|
||||
static int
|
||||
setMenuTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
|
||||
setMenuTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
|
||||
{
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
if (index == WS_SMENU){
|
||||
if (scr->menu_title_pixel[WS_SMENU]!=scr->white_pixel &&
|
||||
scr->menu_title_pixel[WS_SMENU]!=scr->black_pixel) {
|
||||
wFreeColor(scr, scr->menu_title_pixel[WS_SMENU]);
|
||||
}
|
||||
scr->menu_title_pixel[WS_SMENU] = color->pixel;
|
||||
}
|
||||
else {
|
||||
if (scr->menu_title_pixel[0]!=scr->white_pixel &&
|
||||
scr->menu_title_pixel[0]!=scr->black_pixel) {
|
||||
wFreeColor(scr, scr->menu_title_pixel[0]);
|
||||
}
|
||||
scr->menu_title_pixel[0] = color->pixel;
|
||||
}
|
||||
#else /* !TITLE_TEXT_SHADOW */
|
||||
if (scr->menu_title_pixel[0]!=scr->white_pixel &&
|
||||
scr->menu_title_pixel[0]!=scr->black_pixel) {
|
||||
wFreeColor(scr, scr->menu_title_pixel[0]);
|
||||
}
|
||||
|
||||
scr->menu_title_pixel[0] = color->pixel;
|
||||
|
||||
#endif /* !TITLE_TEXT_SHADOW */
|
||||
XSetForeground(dpy, scr->menu_title_gc, color->pixel);
|
||||
|
||||
return REFRESH_FORE_COLOR;
|
||||
@@ -2528,7 +2561,7 @@ setIconTitleBack(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
|
||||
if (scr->icon_title_texture) {
|
||||
wTextureDestroy(scr, (WTexture*)scr->icon_title_texture);
|
||||
}
|
||||
XQueryColor (dpy, scr->colormap, color);
|
||||
XQueryColor (dpy, scr->w_colormap, color);
|
||||
scr->icon_title_texture = wTextureMakeSolid(scr, color);
|
||||
|
||||
return REFRESH_WINDOW_TEXTURES;
|
||||
@@ -2639,15 +2672,19 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
if (scr->flags.backimage_helper_launched) {
|
||||
char *str;
|
||||
|
||||
/* set the default workspace background to this one */
|
||||
str = PLGetDescription(value);
|
||||
if (str) {
|
||||
SendHelperMessage(scr, 'S', 0, str);
|
||||
free(str);
|
||||
} else {
|
||||
if (PLGetNumberOfElements(value)==0) {
|
||||
SendHelperMessage(scr, 'U', 0, NULL);
|
||||
} else {
|
||||
/* set the default workspace background to this one */
|
||||
str = PLGetDescription(value);
|
||||
if (str) {
|
||||
SendHelperMessage(scr, 'S', 0, str);
|
||||
free(str);
|
||||
SendHelperMessage(scr, 'C', scr->current_workspace+1, NULL);
|
||||
} else {
|
||||
SendHelperMessage(scr, 'U', 0, NULL);
|
||||
}
|
||||
}
|
||||
SendHelperMessage(scr, 'C', scr->current_workspace+1, NULL);
|
||||
} else {
|
||||
char *command;
|
||||
char *text;
|
||||
|
||||
+69
-17
@@ -91,7 +91,7 @@ wMessageDialog(WScreen *scr, char *title, char *message,
|
||||
|
||||
WMUnmapWidget(panel->win);
|
||||
|
||||
wUnmanageWindow(wwin, False);
|
||||
wUnmanageWindow(wwin, False, False);
|
||||
|
||||
WMDestroyAlertPanel(panel);
|
||||
|
||||
@@ -142,7 +142,7 @@ wInputDialog(WScreen *scr, char *title, char *message, char **text)
|
||||
else
|
||||
result = NULL;
|
||||
|
||||
wUnmanageWindow(wwin, False);
|
||||
wUnmanageWindow(wwin, False, False);
|
||||
|
||||
WMDestroyInputPanel(panel);
|
||||
|
||||
@@ -380,7 +380,7 @@ buttonCallback(void *self, void *clientData)
|
||||
|
||||
|
||||
Bool
|
||||
wIconChooserDialog(WScreen *scr, char **file)
|
||||
wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
||||
{
|
||||
WWindow *wwin;
|
||||
Window parent;
|
||||
@@ -480,10 +480,22 @@ wIconChooserDialog(WScreen *scr, char **file)
|
||||
|
||||
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
|
||||
|
||||
wwin = wManageInternalWindow(scr, parent, None, _("Icon Chooser"),
|
||||
(scr->scr_width - 450)/2,
|
||||
(scr->scr_height - 280)/2, 450, 280);
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
tmp = malloc((instance ? strlen(instance) : 0)
|
||||
+ (class ? strlen(class) : 0) + 32);
|
||||
|
||||
if (tmp && (instance || class))
|
||||
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
|
||||
else
|
||||
tmp = _("Icon Chooser");
|
||||
|
||||
wwin = wManageInternalWindow(scr, parent, None, tmp,
|
||||
(scr->scr_width - 450)/2,
|
||||
(scr->scr_height - 280)/2, 450, 280);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
/* put icon paths in the list */
|
||||
listIconPaths(panel->dirList);
|
||||
@@ -528,7 +540,7 @@ wIconChooserDialog(WScreen *scr, char **file)
|
||||
|
||||
WMDestroyWidget(panel->win);
|
||||
|
||||
wUnmanageWindow(wwin, False);
|
||||
wUnmanageWindow(wwin, False, False);
|
||||
|
||||
free(panel);
|
||||
|
||||
@@ -568,14 +580,16 @@ typedef struct {
|
||||
RImage *icon;
|
||||
RImage *pic;
|
||||
WMPixmap *oldPix;
|
||||
char *str;
|
||||
char x;
|
||||
#endif
|
||||
} InfoPanel;
|
||||
|
||||
|
||||
|
||||
#define COPYRIGHT_TEXT \
|
||||
"Copyright \xa9 1997, 1998 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
|
||||
"Copyright \xa9 1998 Dan Pascu <dan@windowmaker.org>"
|
||||
"Copyright \xa9 1997~1999 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
|
||||
"Copyright \xa9 1998,1999 Dan Pascu <dan@windowmaker.org>"
|
||||
|
||||
|
||||
|
||||
@@ -602,7 +616,7 @@ destroyInfoPanel(WCoreWindow *foo, void *data, XEvent *event)
|
||||
|
||||
WMDestroyWidget(thePanel->win);
|
||||
|
||||
wUnmanageWindow(thePanel->wwin, False);
|
||||
wUnmanageWindow(thePanel->wwin, False, False);
|
||||
|
||||
free(thePanel);
|
||||
|
||||
@@ -658,14 +672,26 @@ renderText(WMScreen *scr, char *text, char *font, RColor *from, RColor *to)
|
||||
}
|
||||
|
||||
#ifdef SILLYNESS
|
||||
|
||||
extern WMPixmap *DoXThing();
|
||||
extern Bool InitXThing();
|
||||
|
||||
static void
|
||||
logoPushCallback(void *data)
|
||||
{
|
||||
InfoPanel *panel = (InfoPanel*)data;
|
||||
char buffer[512];
|
||||
int i;
|
||||
int len;
|
||||
|
||||
if (panel->cycle < 30) {
|
||||
if (panel->x) {
|
||||
if (!(panel->cycle % 4)) {
|
||||
WMPixmap *p;
|
||||
|
||||
p = DoXThing(panel->wwin);
|
||||
WMSetLabelImage(panel->logoL, p);
|
||||
}
|
||||
} else if (panel->cycle < 30) {
|
||||
RImage *image;
|
||||
WMPixmap *pix;
|
||||
|
||||
@@ -677,11 +703,17 @@ logoPushCallback(void *data)
|
||||
WMReleasePixmap(pix);
|
||||
}
|
||||
|
||||
i = panel->cycle%150;
|
||||
i = panel->cycle%200;
|
||||
|
||||
strncpy(buffer, "Sloppy focus is a *?#@", i<22 ? i : 22);
|
||||
if (i >= 22)
|
||||
memset(&buffer[22], ' ', i-22);
|
||||
len = strlen(panel->str);
|
||||
|
||||
strncpy(buffer, panel->str, i<len ? i : len);
|
||||
if (i >= len)
|
||||
memset(&buffer[len], ' ', i-len);
|
||||
|
||||
strncpy(buffer, panel->str, i<len ? i : len);
|
||||
if (i >= len)
|
||||
memset(&buffer[len], ' ', i-len);
|
||||
buffer[i]=0;
|
||||
WMSetLabelText(panel->versionL, buffer);
|
||||
|
||||
@@ -800,12 +832,18 @@ handleLogoPush(XEvent *event, void *data)
|
||||
" ...XX&v8<30000003-N@... ",
|
||||
" .....XmnbN:q&Bo.... ",
|
||||
" ............ "};
|
||||
static char *msgs[] = {
|
||||
"Sloppy focus is a *?#@",
|
||||
"Repent! Sloppy focus users will burn in hell!!!",
|
||||
"Have a nice day!"
|
||||
};
|
||||
|
||||
clicks++;
|
||||
if (!panel->timer && !broken && clicks > 2) {
|
||||
char *file;
|
||||
char *path;
|
||||
|
||||
panel->x = 0;
|
||||
clicks = 0;
|
||||
if (!panel->icon) {
|
||||
file = wDefaultGetIconFile(panel->scr, "Logo", "WMPanel", False);
|
||||
@@ -851,12 +889,16 @@ handleLogoPush(XEvent *event, void *data)
|
||||
RCombineImageWithColor(panel->pic, &color);
|
||||
}
|
||||
}
|
||||
|
||||
panel->str = msgs[rand()%(sizeof(msgs)/sizeof(char*))];
|
||||
|
||||
panel->timer = WMAddTimerHandler(50, logoPushCallback, panel);
|
||||
panel->cycle = 0;
|
||||
panel->oldPix = WMRetainPixmap(WMGetLabelImage(panel->logoL));
|
||||
} else if (panel->timer) {
|
||||
char version[20];
|
||||
|
||||
panel->x = 0;
|
||||
clicks = 0;
|
||||
WMSetLabelImage(panel->logoL, panel->oldPix);
|
||||
WMReleasePixmap(panel->oldPix);
|
||||
@@ -871,12 +913,13 @@ handleLogoPush(XEvent *event, void *data)
|
||||
|
||||
{
|
||||
XEvent ev;
|
||||
while (XCheckTypedWindowEvent(dpy, WMWidgetXID(panel->versionL),
|
||||
while (XCheckTypedWindowEvent(dpy, WMWidgetXID(panel->versionL),
|
||||
ButtonPress, &ev));
|
||||
}
|
||||
}
|
||||
#endif /* SILLYNESS */
|
||||
|
||||
|
||||
void
|
||||
wShowInfoPanel(WScreen *scr)
|
||||
{
|
||||
@@ -900,6 +943,7 @@ wShowInfoPanel(WScreen *scr)
|
||||
"DirectColor"
|
||||
};
|
||||
|
||||
|
||||
if (thePanel) {
|
||||
wRaiseFrame(thePanel->wwin->frame->core);
|
||||
wSetFocusTo(scr, thePanel->wwin);
|
||||
@@ -1080,6 +1124,14 @@ wShowInfoPanel(WScreen *scr)
|
||||
panel->wwin = wwin;
|
||||
|
||||
thePanel = panel;
|
||||
|
||||
if (InitXThing(panel->scr)) {
|
||||
panel->timer = WMAddTimerHandler(100, logoPushCallback, panel);
|
||||
panel->cycle = 0;
|
||||
panel->x = 1;
|
||||
panel->str = "Merry X'mas!";
|
||||
panel->oldPix = WMRetainPixmap(WMGetLabelImage(panel->logoL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1125,7 +1177,7 @@ destroyLegalPanel(WCoreWindow *foo, void *data, XEvent *event)
|
||||
|
||||
WMDestroyWidget(legalPanel->win);
|
||||
|
||||
wUnmanageWindow(legalPanel->wwin, False);
|
||||
wUnmanageWindow(legalPanel->wwin, False, False);
|
||||
|
||||
free(legalPanel);
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ int wMessageDialog(WScreen *scr, char *title, char *message,
|
||||
char *defBtn, char *altBtn, char *othBtn);
|
||||
int wInputDialog(WScreen *scr, char *title, char *message, char **text);
|
||||
|
||||
Bool wIconChooserDialog(WScreen *scr, char **file);
|
||||
Bool wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class);
|
||||
|
||||
void wShowInfoPanel(WScreen *scr);
|
||||
|
||||
|
||||
+28
-13
@@ -760,10 +760,9 @@ mainIconCreate(WScreen *scr, int type)
|
||||
btn->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;
|
||||
/*x_pos = scr->scr_width - ICON_SIZE*2 - DOCK_EXTRA_SPACE;*/
|
||||
x_pos = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMDock", TILE_NORMAL);
|
||||
x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE;
|
||||
x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE - 1;
|
||||
}
|
||||
|
||||
btn->xindex = 0;
|
||||
@@ -1064,7 +1063,9 @@ dockMenuCreate(WScreen *scr, int type)
|
||||
|
||||
wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL);
|
||||
|
||||
wMenuAddCallback(menu, _("(Un)Hide"), hideCallback, NULL);
|
||||
entry = wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
|
||||
free(entry->text);
|
||||
entry->text = _("Hide");
|
||||
|
||||
wMenuAddCallback(menu, _("Settings..."), settingsCallback, NULL);
|
||||
|
||||
@@ -1615,7 +1616,7 @@ wDockRestoreState(WScreen *scr, proplist_t dock_state, int type)
|
||||
dock->x_pos = DOCK_EXTRA_SPACE;
|
||||
dock->on_right_side = 0;
|
||||
} else {
|
||||
dock->x_pos = scr->scr_width - DOCK_EXTRA_SPACE - ICON_SIZE;
|
||||
dock->x_pos = scr->scr_width - DOCK_EXTRA_SPACE - ICON_SIZE - 1;
|
||||
dock->on_right_side = 1;
|
||||
}
|
||||
}
|
||||
@@ -1829,7 +1830,7 @@ wDockDoAutoLaunch(WDock *dock, int workspace)
|
||||
WSavedState *state;
|
||||
int i;
|
||||
|
||||
for (i=0; i < dock->max_icons; i++) {
|
||||
for (i = 0; i < dock->max_icons; i++) {
|
||||
btn = dock->icon_array[i];
|
||||
if (!btn || !btn->auto_launch)
|
||||
continue;
|
||||
@@ -2333,7 +2334,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
if (abs(ex_x) > DOCK_DETTACH_THRESHOLD)
|
||||
return False;
|
||||
|
||||
if (ex_y >= 0 && ex_y < max_y_icons && (aicon == icon || !aicon)) {
|
||||
if (ex_y >= 0 && ex_y <= max_y_icons && (aicon == icon || !aicon)) {
|
||||
|
||||
*ret_y = ex_y;
|
||||
|
||||
@@ -2369,7 +2370,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
}
|
||||
sig = -sig;
|
||||
}
|
||||
if (done && closest >= 0 && closest < max_y_icons &&
|
||||
if (done && closest >= 0 && closest <= max_y_icons &&
|
||||
((ex_y >= closest && ex_y - closest < DOCK_DETTACH_THRESHOLD+1)
|
||||
||
|
||||
(ex_y < closest && closest - ex_y <= DOCK_DETTACH_THRESHOLD+1))) {
|
||||
@@ -2381,7 +2382,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
} else { /* !redocking */
|
||||
|
||||
/* if slot is free and the icon is close enough, return it */
|
||||
if (!aicon && ex_x == 0 && ex_y >= 0 && ex_y < max_y_icons) {
|
||||
if (!aicon && ex_x == 0 && ex_y >= 0 && ex_y <= max_y_icons) {
|
||||
*ret_y = ex_y;
|
||||
return True;
|
||||
}
|
||||
@@ -2690,7 +2691,7 @@ swapDock(WDock *dock)
|
||||
|
||||
|
||||
if (dock->on_right_side) {
|
||||
x = dock->x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE;
|
||||
x = dock->x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE - 1;
|
||||
} else {
|
||||
x = dock->x_pos = DOCK_EXTRA_SPACE;
|
||||
}
|
||||
@@ -3115,6 +3116,7 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
WScreen *scr = dock->screen_ptr;
|
||||
WObjDescriptor *desc;
|
||||
WMenuEntry *entry;
|
||||
WApplication *wapp = NULL;
|
||||
int index = 0;
|
||||
int x_pos;
|
||||
int appIsRunning = aicon->running && aicon->icon && aicon->icon->owner;
|
||||
@@ -3172,10 +3174,19 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
entry = dock->menu->entries[++index];
|
||||
entry->clientdata = aicon;
|
||||
wMenuSetEnabled(dock->menu, index, appIsRunning);
|
||||
|
||||
|
||||
/* hide */
|
||||
entry = dock->menu->entries[++index];
|
||||
entry->clientdata = aicon;
|
||||
if (aicon->icon->owner) {
|
||||
wapp = wApplicationOf(aicon->icon->owner->main_window);
|
||||
if (wapp && wapp->flags.hidden)
|
||||
entry->text = _("Unhide");
|
||||
else
|
||||
entry->text = _("Hide");
|
||||
} else {
|
||||
entry->text = _("Hide");
|
||||
}
|
||||
wMenuSetEnabled(dock->menu, index, appIsRunning);
|
||||
|
||||
/* settings */
|
||||
@@ -3370,12 +3381,12 @@ handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
|
||||
if (ev.xmotion.x_root > dock->x_pos + ICON_SIZE*2) {
|
||||
XMoveWindow(dpy, scr->dock_shadow, scr->scr_width-ICON_SIZE
|
||||
-DOCK_EXTRA_SPACE, dock->y_pos);
|
||||
-DOCK_EXTRA_SPACE-1, dock->y_pos);
|
||||
if (superfluous) {
|
||||
if (ghost==None) {
|
||||
ghost = MakeGhostDock(dock, dock->x_pos,
|
||||
scr->scr_width-ICON_SIZE
|
||||
-DOCK_EXTRA_SPACE,
|
||||
-DOCK_EXTRA_SPACE-1,
|
||||
dock->y_pos);
|
||||
XSetWindowBackgroundPixmap(dpy, scr->dock_shadow,
|
||||
ghost);
|
||||
@@ -3994,6 +4005,10 @@ clipAutoRaise(void *cdata)
|
||||
if (dock->auto_raise_lower)
|
||||
wDockRaise(dock);
|
||||
|
||||
if (dock->screen_ptr->flags.clip_balloon_mapped) {
|
||||
showClipBalloon(dock, dock->screen_ptr->current_workspace);
|
||||
}
|
||||
|
||||
dock->auto_raise_magic = NULL;
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -164,7 +164,9 @@ chooseIconCallback(WMWidget *self, void *clientData)
|
||||
|
||||
WMSetButtonEnabled(panel->browseBtn, False);
|
||||
|
||||
result = wIconChooserDialog(panel->wwin->screen_ptr, &file);
|
||||
result = wIconChooserDialog(panel->wwin->screen_ptr, &file,
|
||||
panel->editedIcon->wm_instance,
|
||||
panel->editedIcon->wm_class);
|
||||
|
||||
panel->choosingIcon = 0;
|
||||
if (!panel->destroyed) {
|
||||
@@ -403,7 +405,7 @@ DestroyDockAppSettingsPanel(AppSettingsPanel *panel)
|
||||
XUnmapWindow(dpy, panel->wwin->client_win);
|
||||
XReparentWindow(dpy, panel->wwin->client_win,
|
||||
panel->wwin->screen_ptr->root_win, 0, 0);
|
||||
wUnmanageWindow(panel->wwin, False);
|
||||
wUnmanageWindow(panel->wwin, False, False);
|
||||
}
|
||||
|
||||
panel->destroyed = 1;
|
||||
|
||||
+33
-23
@@ -118,6 +118,7 @@ static void handleKeyPress();
|
||||
static void handleFocusIn();
|
||||
static void handleMotionNotify();
|
||||
|
||||
|
||||
#ifdef SHAPE
|
||||
static void handleShapeNotify();
|
||||
#endif
|
||||
@@ -272,7 +273,7 @@ DispatchEvent(XEvent *event)
|
||||
handleEnterNotify(event);
|
||||
break;
|
||||
|
||||
case LeaveNotify:
|
||||
case LeaveNotify:
|
||||
handleLeaveNotify(event);
|
||||
break;
|
||||
|
||||
@@ -296,6 +297,7 @@ DispatchEvent(XEvent *event)
|
||||
|
||||
default:
|
||||
handleExtensions(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,12 +457,10 @@ handleMapRequest(XEvent *ev)
|
||||
#endif
|
||||
|
||||
if ((wwin=wWindowFor(window))) {
|
||||
/* deiconify window */
|
||||
if (wwin->flags.maximized) {
|
||||
wMaximizeWindow(wwin, wwin->flags.maximized);
|
||||
}
|
||||
if (wwin->flags.shaded)
|
||||
if (wwin->flags.shaded) {
|
||||
wUnshadeWindow(wwin);
|
||||
}
|
||||
/* deiconify window */
|
||||
if (wwin->flags.miniaturized) {
|
||||
wDeiconifyWindow(wwin);
|
||||
} else if (wwin->flags.hidden) {
|
||||
@@ -508,12 +508,15 @@ handleMapRequest(XEvent *ev)
|
||||
if (state==IconicState)
|
||||
wwin->flags.miniaturized = 1;
|
||||
|
||||
if (state==WithdrawnState) {
|
||||
if (state == WithdrawnState) {
|
||||
wwin->flags.mapped = 0;
|
||||
wClientSetState(wwin, WithdrawnState, None);
|
||||
wUnmanageWindow(wwin, True);
|
||||
wUnmanageWindow(wwin, True, False);
|
||||
} else {
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
if (wwin->flags.maximized) {
|
||||
wMaximizeWindow(wwin, wwin->flags.maximized);
|
||||
}
|
||||
if (wwin->flags.shaded) {
|
||||
wwin->flags.shaded = 0;
|
||||
wwin->flags.skip_next_animation = 1;
|
||||
@@ -553,7 +556,7 @@ handleDestroyNotify(XEvent *event)
|
||||
|
||||
wwin = wWindowFor(window);
|
||||
if (wwin) {
|
||||
wUnmanageWindow(wwin, False);
|
||||
wUnmanageWindow(wwin, False, True);
|
||||
}
|
||||
|
||||
app = wApplicationOf(window);
|
||||
@@ -647,7 +650,6 @@ handleButtonPress(XEvent *event)
|
||||
event->xbutton.window = scr->switch_menu->frame->core->window;
|
||||
}
|
||||
} else if (event->xbutton.button==wPreferences.select_button) {
|
||||
|
||||
wUnselectWindows(scr);
|
||||
wSelectWindows(scr, event);
|
||||
}
|
||||
@@ -659,7 +661,7 @@ handleButtonPress(XEvent *event)
|
||||
} else if (event->xbutton.button==Button5) {
|
||||
|
||||
wWorkspaceRelativeChange(scr, 1);
|
||||
|
||||
|
||||
}
|
||||
#endif /* MOUSE_WS_SWITCH */
|
||||
}
|
||||
@@ -782,7 +784,7 @@ handleUnmapNotify(XEvent *event)
|
||||
|
||||
/* if the window was reparented, do not reparent it back to the
|
||||
* root window */
|
||||
wUnmanageWindow(wwin, !reparented);
|
||||
wUnmanageWindow(wwin, !reparented, False);
|
||||
}
|
||||
XUngrabServer(dpy);
|
||||
}
|
||||
@@ -832,8 +834,8 @@ handlePropertyNotify(XEvent *event)
|
||||
wClientCheckProperty(wapp->main_window_desc, &event->xproperty);
|
||||
}
|
||||
|
||||
scr = wScreenForRootWindow(event->xproperty.window);
|
||||
if (scr) {
|
||||
scr = wScreenForWindow(event->xproperty.window);
|
||||
if (scr && scr->root_win == event->xproperty.window) {
|
||||
#ifdef KWM_HINTS
|
||||
wKWMCheckRootHintChange(scr, &event->xproperty);
|
||||
#endif
|
||||
@@ -1015,18 +1017,24 @@ handleEnterNotify(XEvent *event)
|
||||
scr->autoRaiseTimer = NULL;
|
||||
}
|
||||
} else {
|
||||
/* set focus if in focus-follows-mouse mode and the event
|
||||
/* set auto raise timer even if in focus-follows-mouse mode
|
||||
* and the event is for the frame window, even if the window
|
||||
* has focus already. useful if you move the pointer from a focused
|
||||
* window to the root window and back pretty fast
|
||||
*
|
||||
* set focus if in focus-follows-mouse mode and the event
|
||||
* is for the frame window and window doesn't have focus yet */
|
||||
if ((wPreferences.focus_mode==WKF_POINTER
|
||||
|| wPreferences.focus_mode==WKF_SLOPPY)
|
||||
&& wwin->frame->core->window==event->xcrossing.window
|
||||
&& !wwin->flags.focused) {
|
||||
wSetFocusTo(scr, wwin);
|
||||
|
||||
if (scr->autoRaiseTimer)
|
||||
WMDeleteTimerHandler(scr->autoRaiseTimer);
|
||||
scr->autoRaiseTimer = NULL;
|
||||
|
||||
&& wwin->frame->core->window==event->xcrossing.window) {
|
||||
|
||||
if (!wwin->flags.focused)
|
||||
wSetFocusTo(scr, wwin);
|
||||
|
||||
if (scr->autoRaiseTimer)
|
||||
WMDeleteTimerHandler(scr->autoRaiseTimer);
|
||||
scr->autoRaiseTimer = NULL;
|
||||
|
||||
if (wPreferences.raise_delay && !WFLAGP(wwin, no_focusable)) {
|
||||
scr->autoRaiseWindow = wwin->frame->core->window;
|
||||
scr->autoRaiseTimer
|
||||
@@ -1533,3 +1541,5 @@ handleMotionNotify(XEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+42
-4
@@ -759,12 +759,28 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
||||
|
||||
XSetForeground(dpy, *fwin->title_gc,
|
||||
fwin->title_pixel[fwin->flags.state]);
|
||||
|
||||
|
||||
wDrawString(fwin->titlebar->window, *fwin->font,
|
||||
*fwin->title_gc, x,
|
||||
(*fwin->font)->y + TITLEBAR_EXTRA_HEIGHT/2, title,
|
||||
titlelen);
|
||||
|
||||
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
if(wPreferences.title_shadow){
|
||||
int shadowx,shadowy;
|
||||
XSetForeground(dpy, *fwin->title_gc,
|
||||
fwin->title_pixel[fwin->flags.state+3]);
|
||||
for(shadowx=0;shadowx<TITLE_TEXT_SHADOW_WIDTH;shadowx++)
|
||||
for(shadowy=0;shadowy<TITLE_TEXT_SHADOW_HEIGHT;shadowy++)
|
||||
wDrawString(fwin->titlebar->window, *fwin->font,
|
||||
*fwin->title_gc,
|
||||
x + shadowx + TITLE_TEXT_SHADOW_X_OFFSET,
|
||||
(*fwin->font)->y + TITLEBAR_EXTRA_HEIGHT/2
|
||||
+ shadowy + TITLE_TEXT_SHADOW_Y_OFFSET, title,
|
||||
titlelen);
|
||||
}
|
||||
#endif /* TITLE_TEXT_SHADOW */
|
||||
|
||||
free(title);
|
||||
}
|
||||
}
|
||||
@@ -900,6 +916,20 @@ wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title)
|
||||
}
|
||||
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
void
|
||||
wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed)
|
||||
{
|
||||
fwin->flags.right_button_pushed_in = pushed;
|
||||
|
||||
paintButton(fwin->right_button, fwin->title_texture[fwin->flags.state],
|
||||
fwin->title_pixel[fwin->flags.state],
|
||||
fwin->rbutton_image, pushed);
|
||||
}
|
||||
#endif /* OLWM_HINTS */
|
||||
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
static void
|
||||
@@ -952,6 +982,7 @@ checkTitleSize(WFrameWindow *fwin)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
paintButton(WCoreWindow *button, WTexture *texture, unsigned long color,
|
||||
WPixmap *image, int pushed)
|
||||
@@ -1050,15 +1081,22 @@ handleButtonExpose(WObjDescriptor *desc, XEvent *event)
|
||||
{
|
||||
WFrameWindow *fwin = (WFrameWindow*)desc->parent;
|
||||
WCoreWindow *button = (WCoreWindow*)desc->self;
|
||||
|
||||
|
||||
if (button == fwin->left_button) {
|
||||
paintButton(button, fwin->title_texture[fwin->flags.state],
|
||||
fwin->title_pixel[fwin->flags.state],
|
||||
fwin->lbutton_image, False);
|
||||
} else {
|
||||
Bool pushed = False;
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
if (fwin->flags.right_button_pushed_in)
|
||||
pushed = True;
|
||||
#endif
|
||||
/* emulate the olwm pushpin in the "out" state */
|
||||
paintButton(button, fwin->title_texture[fwin->flags.state],
|
||||
fwin->title_pixel[fwin->flags.state],
|
||||
fwin->rbutton_image, False);
|
||||
fwin->rbutton_image, pushed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,10 @@ typedef struct WFrameWindow {
|
||||
unsigned int is_client_window_frame:1;
|
||||
|
||||
unsigned int incomplete_title:1;
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
unsigned int right_button_pushed_in:1;
|
||||
#endif
|
||||
} flags;
|
||||
} WFrameWindow;
|
||||
|
||||
@@ -137,5 +141,8 @@ void wFrameWindowHideButton(WFrameWindow *fwin, int flags);
|
||||
|
||||
int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title);
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
void wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+3
-1
@@ -464,7 +464,9 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
||||
} else {
|
||||
done = False;
|
||||
}
|
||||
return done;
|
||||
|
||||
if (done)
|
||||
return True;
|
||||
}
|
||||
|
||||
/* window specific client messages */
|
||||
|
||||
@@ -98,6 +98,11 @@
|
||||
* wmaker:exit - exit wmaker
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO
|
||||
* different WORKAREA for each workspace
|
||||
*/
|
||||
|
||||
|
||||
#include "wconfig.h"
|
||||
|
||||
@@ -151,6 +156,7 @@ static Atom _XA_KWM_RUNNING = 0;
|
||||
static Atom _XA_KWM_MODULE = 0;
|
||||
|
||||
static Atom _XA_KWM_MODULE_INIT = 0;
|
||||
static Atom _XA_KWM_MODULE_INITIALIZED = 0;
|
||||
static Atom _XA_KWM_MODULE_DESKTOP_CHANGE = 0;
|
||||
static Atom _XA_KWM_MODULE_DESKTOP_NAME_CHANGE = 0;
|
||||
static Atom _XA_KWM_MODULE_DESKTOP_NUMBER_CHANGE = 0;
|
||||
@@ -264,6 +270,31 @@ sendClientMessage(WScreen *scr, Window window, Atom atom, long value)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sendTextMessage(WScreen *scr, Window window, Atom atom, char *text)
|
||||
{
|
||||
XEvent event;
|
||||
long mask = 0;
|
||||
int i;
|
||||
|
||||
assert(atom!=0);
|
||||
|
||||
memset(&event, 0, sizeof(XEvent));
|
||||
event.xclient.type = ClientMessage;
|
||||
event.xclient.message_type = atom;
|
||||
event.xclient.window = window;
|
||||
event.xclient.format = 8;
|
||||
|
||||
for (i=0; i<20 && text[i]; i++)
|
||||
event.xclient.data.b[i] = text[i];
|
||||
|
||||
if (scr && scr->root_win == window)
|
||||
mask = SubstructureRedirectMask;
|
||||
|
||||
XSendEvent(dpy, window, False, mask, &event);
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
getAreaHint(Window win, Atom atom, WArea *area)
|
||||
{
|
||||
@@ -334,6 +365,7 @@ addModule(WScreen *scr, Window window)
|
||||
}
|
||||
}
|
||||
|
||||
/* send list of windows */
|
||||
for (ptr = scr->focused_window; ptr!=NULL; ptr = ptr->prev) {
|
||||
if (!ptr->flags.kwm_hidden_for_modules
|
||||
&& !WFLAGP(ptr, skip_window_list)) {
|
||||
@@ -341,12 +373,21 @@ addModule(WScreen *scr, Window window)
|
||||
ptr->client_win);
|
||||
}
|
||||
}
|
||||
|
||||
/* send window stacking order */
|
||||
wKWMSendStacking(scr, window);
|
||||
|
||||
/* send focused window */
|
||||
if (scr->focused_window && scr->focused_window->flags.focused) {
|
||||
sendClientMessage(scr, window, _XA_KWM_MODULE_WIN_ACTIVATE,
|
||||
scr->focused_window->client_win);
|
||||
}
|
||||
|
||||
/* tell who we are */
|
||||
sendTextMessage(scr, window, _XA_KWM_COMMAND, "wm:wmaker");
|
||||
|
||||
|
||||
sendClientMessage(scr, window, _XA_KWM_MODULE_INITIALIZED, 0);
|
||||
#ifdef DEBUG1
|
||||
KWMModules->title = NULL;
|
||||
XFetchName(dpy, window, &KWMModules->title);
|
||||
@@ -539,9 +580,13 @@ wKWMInitStuff(WScreen *scr)
|
||||
_XA_KWM_MODULE = XInternAtom(dpy, "KWM_MODULE", False);
|
||||
|
||||
_XA_KWM_MODULE_INIT = XInternAtom(dpy, "KWM_MODULE_INIT", False);
|
||||
_XA_KWM_MODULE_INITIALIZED = XInternAtom(dpy, "KWM_MODULE_INITIALIZED", False);
|
||||
|
||||
/* dunno what these do, but Matthias' patch contains it... */
|
||||
_XA_KWM_MODULE_DESKTOP_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_CHANGE", False);
|
||||
_XA_KWM_MODULE_DESKTOP_NAME_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_NAME_CHANGE", False);
|
||||
_XA_KWM_MODULE_DESKTOP_NUMBER_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_NUMBER_CHANGE", False);
|
||||
|
||||
_XA_KWM_MODULE_WIN_ADD = XInternAtom(dpy, "KWM_MODULE_WIN_ADD", False);
|
||||
_XA_KWM_MODULE_WIN_REMOVE = XInternAtom(dpy, "KWM_MODULE_WIN_REMOVE", False);
|
||||
_XA_KWM_MODULE_WIN_CHANGE = XInternAtom(dpy, "KWM_MODULE_WIN_CHANGE", False);
|
||||
@@ -597,6 +642,19 @@ wKWMSendStacking(WScreen *scr, Window module)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wKWMBroadcastStacking(WScreen *scr)
|
||||
{
|
||||
KWMModuleList *ptr = KWMModules;
|
||||
|
||||
while (ptr) {
|
||||
wKWMSendStacking(scr, ptr->window);
|
||||
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
wKWMGetWorkspaceName(WScreen *scr, int workspace)
|
||||
{
|
||||
@@ -963,7 +1021,7 @@ performCommand(WScreen *scr, char *command, XClientMessageEvent *event)
|
||||
|| strcmp(command, "execute")==0) {
|
||||
char *cmd;
|
||||
|
||||
cmd = ExpandOptions(scr, _("%a(Run Command,Type the command to run"));
|
||||
cmd = ExpandOptions(scr, _("%a(Run Command,Type the command to run:)"));
|
||||
if (cmd) {
|
||||
ExecuteShellCommand(scr, cmd);
|
||||
free(cmd);
|
||||
@@ -1043,7 +1101,7 @@ performCommand(WScreen *scr, char *command, XClientMessageEvent *event)
|
||||
} else if (strcmp(command, "moduleRaised")==0) { /* useless */
|
||||
} else if (strcmp(command, "deskUnclutter")==0) {
|
||||
} else if (strcmp(command, "deskCascade")==0) {
|
||||
} else if (strcmp(command, "configure")==0) { /* useless */
|
||||
} else if (strcmp(command, "configure")==0) {
|
||||
} else if (strcmp(command, "taskManager")==0) {
|
||||
} else if (strcmp(command, "darkenScreen")==0) { /* breaks consistency */
|
||||
#endif
|
||||
@@ -1276,6 +1334,9 @@ wKWMManageableClient(WScreen *scr, Window win, char *title)
|
||||
}
|
||||
|
||||
ptr = KWMDoNotManageCrap;
|
||||
/*
|
||||
* TODO: support for glob patterns or regexes
|
||||
*/
|
||||
if (ptr && strncmp(ptr->title, title, strlen(ptr->title))==0) {
|
||||
next = ptr->next;
|
||||
free(ptr);
|
||||
@@ -1456,6 +1517,7 @@ wKWMGetUsableArea(WScreen *scr, WArea *area)
|
||||
}
|
||||
|
||||
|
||||
#ifdef not_used
|
||||
void
|
||||
wKWMSetUsableAreaHint(WScreen *scr, int workspace)
|
||||
{
|
||||
@@ -1463,6 +1525,16 @@ wKWMSetUsableAreaHint(WScreen *scr, int workspace)
|
||||
* the next time the area changes, we won't know what should
|
||||
* be the new final area. This protocol isn't worth a shit :/
|
||||
*/
|
||||
/*
|
||||
* According to Matthias Ettrich:
|
||||
* Indeed, there's no protocol to deal with the area yet in case several
|
||||
* clients want to influence it. It is sufficent, though, if it is clear
|
||||
* that one process is responsable for the area. For KDE this is kpanel, but
|
||||
* I see that there might be a conflict with the docking area of windowmaker
|
||||
* itself.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef notdef
|
||||
char buffer[64];
|
||||
|
||||
@@ -1478,7 +1550,7 @@ wKWMSetUsableAreaHint(WScreen *scr, int workspace)
|
||||
scr->totalUsableArea);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* not_used */
|
||||
|
||||
void
|
||||
wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message)
|
||||
|
||||
@@ -69,7 +69,9 @@ Bool wKWMManageableClient(WScreen *scr, Window win, char *title);
|
||||
|
||||
void wKWMCheckClientInitialState(WWindow *wwin);
|
||||
|
||||
#ifdef not_used
|
||||
void wKWMSetUsableAreaHint(WScreen *scr, int workspace);
|
||||
#endif
|
||||
|
||||
void wKWMSetInitializedHint(WScreen *scr);
|
||||
|
||||
@@ -87,6 +89,8 @@ void wKWMUpdateActiveWindowHint(WScreen *scr);
|
||||
|
||||
void wKWMSendStacking(WScreen *scr, Window module);
|
||||
|
||||
void wKWMBroadcastStacking(WScreen *scr);
|
||||
|
||||
char *wKWMGetWorkspaceName(WScreen *scr, int workspace);
|
||||
|
||||
#endif
|
||||
|
||||
+32
-20
@@ -106,6 +106,7 @@ Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
Atom _XA_WINDOWMAKER_STATE;
|
||||
|
||||
Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
|
||||
#ifdef OFFIX_DND
|
||||
Atom _XA_DND_PROTOCOL;
|
||||
@@ -156,7 +157,7 @@ extern void StartUp();
|
||||
void
|
||||
Exit(int status)
|
||||
{
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
wSessionDisconnectManager();
|
||||
#endif
|
||||
XCloseDisplay(dpy);
|
||||
@@ -180,7 +181,7 @@ Restart(char *manager)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
wSessionDisconnectManager();
|
||||
#endif
|
||||
XCloseDisplay(dpy);
|
||||
@@ -250,20 +251,21 @@ wAbort(Bool dumpCore)
|
||||
void
|
||||
print_help()
|
||||
{
|
||||
printf(_("usage: %s [-options]\n"), ProgName);
|
||||
printf(_("usage: %s [options]\n"), ProgName);
|
||||
puts(_("options:"));
|
||||
#ifdef USECPP
|
||||
puts(_(" -nocpp disable preprocessing of configuration files"));
|
||||
puts(_(" --no-cpp disable preprocessing of configuration files"));
|
||||
#endif
|
||||
puts(_(" -nodock do not open the application Dock"));
|
||||
puts(_(" -noclip do not open the workspace Clip"));
|
||||
puts(_(" --no-dock do not open the application Dock"));
|
||||
puts(_(" --no-clip do not open the workspace Clip"));
|
||||
/*
|
||||
puts(_(" -locale locale locale to use"));
|
||||
puts(_(" --locale locale locale to use"));
|
||||
*/
|
||||
puts(_(" -visualid visualid visual id of visual to use"));
|
||||
puts(_(" --visual-id visualid visual id of visual to use"));
|
||||
puts(_(" -display host:dpy display to use"));
|
||||
puts(_(" -static do not update or save configurations"));
|
||||
puts(_(" -version print version and exit"));
|
||||
puts(_(" --static do not update or save configurations"));
|
||||
puts(_(" --version print version and exit"));
|
||||
puts(_(" --help show this message"));
|
||||
}
|
||||
|
||||
|
||||
@@ -328,6 +330,8 @@ main(int argc, char **argv)
|
||||
char *str;
|
||||
int d, s;
|
||||
|
||||
wsetabort(wAbort);
|
||||
|
||||
ArgCount = argc;
|
||||
Arguments = argv;
|
||||
|
||||
@@ -348,21 +352,26 @@ main(int argc, char **argv)
|
||||
if (argc>1) {
|
||||
for (i=1; i<argc; i++) {
|
||||
#ifdef USECPP
|
||||
if (strcmp(argv[i], "-nocpp")==0) {
|
||||
if (strcmp(argv[i], "-nocpp")==0
|
||||
|| strcmp(argv[i], "--no-cpp")==0) {
|
||||
wPreferences.flags.nocpp=1;
|
||||
} else
|
||||
#endif
|
||||
if (strcmp(argv[i], "-nodock")==0) {
|
||||
if (strcmp(argv[i], "-nodock")==0
|
||||
|| strcmp(argv[i], "--no-dock")==0) {
|
||||
wPreferences.flags.nodock=1;
|
||||
} else if (strcmp(argv[i], "-noclip")==0) {
|
||||
} else if (strcmp(argv[i], "-noclip")==0
|
||||
|| strcmp(argv[i], "--no-clip")==0) {
|
||||
wPreferences.flags.noclip=1;
|
||||
} else if (strcmp(argv[i], "-version")==0) {
|
||||
} else if (strcmp(argv[i], "-version")==0
|
||||
|| strcmp(argv[i], "--version")==0) {
|
||||
printf("Window Maker %s\n", VERSION);
|
||||
exit(0);
|
||||
} else if (strcmp(argv[i], "-global_defaults_path")==0) {
|
||||
} else if (strcmp(argv[i], "--global_defaults_path")==0) {
|
||||
printf("%s/Defaults/WindowMaker", PKGDATADIR);
|
||||
exit(0);
|
||||
} else if (strcmp(argv[i], "-locale")==0) {
|
||||
} else if (strcmp(argv[i], "-locale")==0
|
||||
|| strcmp(argv[i], "--locale")==0) {
|
||||
i++;
|
||||
if (i>=argc) {
|
||||
wwarning(_("too few arguments for %s"), argv[i-1]);
|
||||
@@ -376,7 +385,8 @@ main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
DisplayName = argv[i];
|
||||
} else if (strcmp(argv[i], "-visualid")==0) {
|
||||
} else if (strcmp(argv[i], "-visualid")==0
|
||||
|| strcmp(argv[i], "--visual-id")==0) {
|
||||
i++;
|
||||
if (i>=argc) {
|
||||
wwarning(_("too few arguments for %s"), argv[i-1]);
|
||||
@@ -386,9 +396,11 @@ main(int argc, char **argv)
|
||||
wwarning(_("bad value for visualid: \"%s\""), argv[i]);
|
||||
exit(0);
|
||||
}
|
||||
} else if (strcmp(argv[i], "-static")==0) {
|
||||
} else if (strcmp(argv[i], "-static")==0
|
||||
|| strcmp(argv[i], "--static")==0) {
|
||||
|
||||
wPreferences.flags.noupdates = 1;
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
} else if (strcmp(argv[i], "-clientid")==0
|
||||
|| strcmp(argv[i], "-restore")==0) {
|
||||
i++;
|
||||
@@ -496,7 +508,7 @@ main(int argc, char **argv)
|
||||
wSoundInitialize();
|
||||
#endif
|
||||
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
wSessionConnectManager(argv, argc);
|
||||
#endif
|
||||
|
||||
|
||||
+35
-16
@@ -782,7 +782,8 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
char *ret;
|
||||
char *title;
|
||||
char *prompt;
|
||||
int j, k, state;
|
||||
int j, state;
|
||||
int begin;
|
||||
char tbuffer[256], pbuffer[256];
|
||||
|
||||
title = _("Program Arguments");
|
||||
@@ -796,11 +797,12 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
|
||||
state = _STARTING;
|
||||
j = 0;
|
||||
for (; line[*ptr]==0 && state!=_DONE; *ptr++) {
|
||||
for (; line[*ptr]!=0 && state!=_DONE; (*ptr)++) {
|
||||
switch (state) {
|
||||
case _STARTING:
|
||||
if (line[*ptr]=='(') {
|
||||
state = _TITLE;
|
||||
begin = *ptr+1;
|
||||
} else {
|
||||
state = _DONE;
|
||||
}
|
||||
@@ -810,37 +812,38 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
if (j <= 0 && line[*ptr]==',') {
|
||||
|
||||
j = 0;
|
||||
if (*ptr > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(*ptr, 255));
|
||||
tbuffer[WMIN(*ptr, 255)] = 0;
|
||||
if (*ptr > begin) {
|
||||
strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, 255));
|
||||
tbuffer[WMIN(*ptr-begin, 255)] = 0;
|
||||
title = (char*)tbuffer;
|
||||
}
|
||||
k = *ptr+1;
|
||||
begin = *ptr+1;
|
||||
state = _PROMPT;
|
||||
|
||||
} else if (j <= 0 && line[*ptr]==')') {
|
||||
|
||||
if (*ptr > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(*ptr, 255));
|
||||
tbuffer[WMIN(*ptr, 255)] = 0;
|
||||
if (*ptr > begin) {
|
||||
strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, 255));
|
||||
tbuffer[WMIN(*ptr-begin, 255)] = 0;
|
||||
title = (char*)tbuffer;
|
||||
}
|
||||
state = _DONE;
|
||||
|
||||
} else if (line[*ptr]=='(')
|
||||
j++;
|
||||
else if (line[*ptr]==')')
|
||||
} else if (line[*ptr]=='(') {
|
||||
j++;
|
||||
} else if (line[*ptr]==')') {
|
||||
j--;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case _PROMPT:
|
||||
if (line[*ptr]==')' && j==0) {
|
||||
|
||||
if (*ptr-k > 1) {
|
||||
strncpy(pbuffer, &line[k], WMIN(*ptr-k, 255));
|
||||
pbuffer[WMIN(*ptr-k, 255)] = 0;
|
||||
title = (char*)pbuffer;
|
||||
if (*ptr-begin > 1) {
|
||||
strncpy(pbuffer, &line[begin], WMIN(*ptr-begin, 255));
|
||||
pbuffer[WMIN(*ptr-begin, 255)] = 0;
|
||||
prompt = (char*)pbuffer;
|
||||
}
|
||||
state = _DONE;
|
||||
} else if (line[*ptr]=='(')
|
||||
@@ -919,6 +922,7 @@ get_dnd_selection(WScreen *scr)
|
||||
* OPTION w NORMAL <selected window id>
|
||||
* OPTION a NORMAL <input text>
|
||||
* OPTION d NORMAL <OffiX DND selection object>
|
||||
* OPTION W NORMAL <current workspace>
|
||||
* OPTION etc. NORMAL %<input>
|
||||
*/
|
||||
#define TMPBUFSIZE 64
|
||||
@@ -1004,6 +1008,21 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
sprintf(tmpbuf, "0x%x",
|
||||
(unsigned int)scr->current_workspace);
|
||||
slen = strlen(tmpbuf);
|
||||
olen += slen;
|
||||
nout = realloc(out,olen);
|
||||
if (!nout) {
|
||||
wwarning(_("out of memory during expansion of \"%W\""));
|
||||
goto error;
|
||||
}
|
||||
out = nout;
|
||||
strcat(out,tmpbuf);
|
||||
optr+=slen;
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
ptr++;
|
||||
user_input = getuserinput(scr, cmdline, &ptr);
|
||||
|
||||
+90
-54
@@ -670,7 +670,7 @@ _keyloop(_looper *lpr){
|
||||
}
|
||||
|
||||
#endif
|
||||
#define _KS 20;
|
||||
#define _KS 20
|
||||
|
||||
int
|
||||
wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
@@ -686,6 +686,8 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
int src_x = wwin->frame_x;
|
||||
int src_y = wwin->frame_y;
|
||||
int done,off_x,off_y,ww,wh;
|
||||
int kspeed = 1;
|
||||
Time lastTime = 0;
|
||||
KeySym keysym=NoSymbol;
|
||||
KeyCode shiftl,shiftr,ctrll,ctrlmode;
|
||||
|
||||
@@ -710,11 +712,19 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
wUnselectWindows(scr);
|
||||
}
|
||||
XGrabServer(dpy);
|
||||
if (!scr->selected_windows){
|
||||
drawTransparentFrame(wwin, src_x, src_y, w, h);
|
||||
mapPositionDisplay(wwin, src_x, src_y, w, h);
|
||||
} else {
|
||||
drawFrames(wwin,scr->selected_windows,0,0,0,0);
|
||||
XGrabPointer(dpy, scr->root_win, True, PointerMotionMask
|
||||
|ButtonReleaseMask|ButtonPressMask, GrabModeAsync,
|
||||
GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime);
|
||||
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
if(scr->selected_windows)
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
else drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
|
||||
if(!scr->selected_windows)
|
||||
mapPositionDisplay(wwin, src_x, src_y, w, h);
|
||||
}
|
||||
else {
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
|
||||
}
|
||||
ww=w;
|
||||
wh=h;
|
||||
@@ -725,17 +735,34 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
*/
|
||||
WMMaskEvent(dpy, KeyPressMask | ButtonReleaseMask
|
||||
| ButtonPressMask | ExposureMask, &event);
|
||||
if (!scr->selected_windows){
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
if(scr->selected_windows)
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
else drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
|
||||
/*** I HATE EDGE RESISTANCE - ]d ***/
|
||||
}
|
||||
else {
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
|
||||
if(ctrlmode)
|
||||
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
|
||||
|
||||
XUngrabServer(dpy);
|
||||
XSync(dpy, False);
|
||||
|
||||
switch (event.type) {
|
||||
case KeyPress:
|
||||
if (event.xkey.state & ControlMask){
|
||||
/* accelerate */
|
||||
if (event.xkey.time - lastTime > 50) {
|
||||
kspeed = 1;
|
||||
} else {
|
||||
if (kspeed < 20)
|
||||
kspeed++;
|
||||
}
|
||||
lastTime = event.xkey.time;
|
||||
|
||||
if (event.xkey.state & ControlMask && !wwin->flags.shaded){
|
||||
ctrlmode=1;
|
||||
wUnselectWindows(scr);
|
||||
}
|
||||
@@ -761,33 +788,33 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
case XK_KP_Up:
|
||||
case XK_k:
|
||||
if (ctrlmode){
|
||||
h-=_KS;
|
||||
h-=kspeed;
|
||||
}
|
||||
else off_y-=_KS;
|
||||
else off_y-=kspeed;
|
||||
break;
|
||||
case XK_Down:
|
||||
case XK_KP_Down:
|
||||
case XK_j:
|
||||
if (ctrlmode){
|
||||
h+=_KS;
|
||||
h+=kspeed;
|
||||
}
|
||||
else off_y+=_KS;
|
||||
else off_y+=kspeed;
|
||||
break;
|
||||
case XK_Left:
|
||||
case XK_KP_Left:
|
||||
case XK_h:
|
||||
if (ctrlmode){
|
||||
w-=_KS;
|
||||
w-=kspeed;
|
||||
}
|
||||
else off_x-=_KS;
|
||||
else off_x-=kspeed;
|
||||
break;
|
||||
case XK_Right:
|
||||
case XK_KP_Right:
|
||||
case XK_l:
|
||||
if (ctrlmode){
|
||||
w+=_KS;
|
||||
w+=kspeed;
|
||||
}
|
||||
else off_x+=_KS;
|
||||
else off_x+=kspeed;
|
||||
break;
|
||||
}
|
||||
ww=w;wh=h;
|
||||
@@ -833,30 +860,38 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
WMHandleEvent(&event);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
XUngrabServer(dpy);
|
||||
WMHandleEvent(&event);
|
||||
XSync(dpy, False);
|
||||
XGrabServer(dpy);
|
||||
* */
|
||||
if (!scr->selected_windows){
|
||||
|
||||
XGrabServer(dpy);
|
||||
/*xxx*/
|
||||
|
||||
if (wwin->flags.shaded && !scr->selected_windows){
|
||||
moveGeometryDisplayCentered(scr, src_x+off_x + w/2, src_y+off_y + h/2);
|
||||
}
|
||||
else {
|
||||
if(ctrlmode){
|
||||
unmapPositionDisplay(wwin);
|
||||
mapGeometryDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
else {
|
||||
else if(!scr->selected_windows){
|
||||
unmapGeometryDisplay(wwin);
|
||||
mapPositionDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
if(scr->selected_windows)
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
else drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
|
||||
}
|
||||
else {
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
|
||||
|
||||
if(ctrlmode){
|
||||
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
|
||||
}
|
||||
else
|
||||
else if(!scr->selected_windows)
|
||||
showPosition(wwin, src_x+off_x, src_y+off_y);
|
||||
/**/
|
||||
|
||||
@@ -865,12 +900,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
/*
|
||||
WMDeleteTimerWithClientData(&looper);
|
||||
*/
|
||||
if (!scr->selected_windows){
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
else {
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
}
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
if(scr->selected_windows)
|
||||
drawFrames(wwin,scr->selected_windows,off_x,off_y,0,0);
|
||||
else drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
|
||||
}
|
||||
else {
|
||||
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
|
||||
}
|
||||
|
||||
if(ctrlmode){
|
||||
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
|
||||
unmapGeometryDisplay(wwin);
|
||||
@@ -878,20 +916,27 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
else
|
||||
unmapPositionDisplay(wwin);
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XUngrabServer(dpy);
|
||||
if(done==2){
|
||||
if (!scr->selected_windows){
|
||||
wWindowConfigure(wwin, src_x+off_x, src_y+off_y, ww, wh - vert_border);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
}
|
||||
else {
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
LinkedList *list;
|
||||
list=scr->selected_windows;
|
||||
doWindowMove(wwin,0,0,scr->selected_windows,off_x,off_y,0,0);
|
||||
while (list) {
|
||||
wWindowSynthConfigureNotify(list->head);
|
||||
list = list->tail;
|
||||
if(!scr->selected_windows){
|
||||
wWindowMove(wwin, src_x+off_x, src_y+off_y);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
}
|
||||
else {
|
||||
doWindowMove(wwin,0,0,scr->selected_windows,off_x,off_y,0,0);
|
||||
while (list) {
|
||||
wWindowSynthConfigureNotify(list->head);
|
||||
list = list->tail;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wWindowConfigure(wwin, src_x+off_x, src_y+off_y, ww, wh - vert_border);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
}
|
||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
||||
wSetFocusTo(scr, wwin);
|
||||
@@ -908,7 +953,7 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
XEvent event;
|
||||
Window root = scr->root_win;
|
||||
KeyCode shiftl, shiftr, tab;
|
||||
KeyCode shiftl, shiftr;
|
||||
int w = wwin->frame->core->width;
|
||||
int h = wwin->frame->core->height;
|
||||
int x = wwin->frame_x;
|
||||
@@ -921,7 +966,6 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
/* This needs not to change while moving, else bad things can happen */
|
||||
int opaque_move = wPreferences.opaque_move;
|
||||
int XOffset, YOffset, origDragX, origDragY;
|
||||
int grid = 0;
|
||||
|
||||
origDragX = wwin->frame_x;
|
||||
origDragY = wwin->frame_y;
|
||||
@@ -942,7 +986,6 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
#endif
|
||||
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
tab = XKeysymToKeycode(dpy, XK_Tab);
|
||||
while (1) {
|
||||
if (warped) {
|
||||
int junk;
|
||||
@@ -984,17 +1027,10 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
}
|
||||
showPosition(wwin, x, y);
|
||||
}
|
||||
if (event.xkey.keycode == tab) {
|
||||
grid = !grid;
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
if (started) {
|
||||
if (grid) {
|
||||
event.xmotion.x_root = (event.xmotion.x_root/10)*10;
|
||||
event.xmotion.y_root = (event.xmotion.y_root/10)*10;
|
||||
}
|
||||
showPosition(wwin, x, y);
|
||||
|
||||
if (!opaque_move) {
|
||||
|
||||
+75
-26
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* based on olwm code
|
||||
* Semantics and hint information taken from olwm code
|
||||
*/
|
||||
|
||||
#include "wconfig.h"
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -83,21 +84,20 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned long flags;
|
||||
unsigned long state;
|
||||
} OLWindowState;
|
||||
unsigned used:1;
|
||||
|
||||
#define OL_STATE_SEMANTIC (1<<0)
|
||||
unsigned semantic:1;
|
||||
|
||||
#define OL_STATE_COMPOSE (1<<0)
|
||||
#define OL_STATE_CAPSLOCK (1<<1)
|
||||
#define OL_STATE_NUMLOCK (1<<2)
|
||||
#define OL_STATE_SCROLLLOCK (1<<3)
|
||||
unsigned semantic_compose:1;
|
||||
unsigned semantic_capslock:1;
|
||||
unsigned semantic_numlock:1;
|
||||
unsigned semantic_scrolllock:1;
|
||||
} WOLWindowState;
|
||||
|
||||
|
||||
static Atom _XA_SUN_WM_PROTOCOLS = 0;
|
||||
|
||||
|
||||
#ifdef unused
|
||||
static Bool
|
||||
getWindowState(Window win, OLWindowState *state)
|
||||
{
|
||||
@@ -122,13 +122,14 @@ getWindowState(Window win, OLWindowState *state)
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
getWindowHints(Window window, OLHints *hints)
|
||||
{
|
||||
long *data;
|
||||
int count;
|
||||
static Atom _XA_OL_WIN_ATTR = 0;
|
||||
|
||||
if (!_XA_OL_WIN_ATTR) {
|
||||
_XA_OL_WIN_ATTR = XInternAtom(dpy, "_OL_WIN_ATTR", False);
|
||||
@@ -163,6 +164,8 @@ getWindowHints(Window window, OLHints *hints)
|
||||
return False;
|
||||
}
|
||||
|
||||
printf("WINDOW TYPE %s\n", XGetAtomName(dpy, hints->winType));
|
||||
|
||||
XFree(data);
|
||||
|
||||
/* do backward compatibility stuff */
|
||||
@@ -209,8 +212,8 @@ applyDecorationHints(Window win, int *flags)
|
||||
_XA_ICONNAME = XInternAtom(dpy, "_OL_DECOR_ICON_NAME", False);
|
||||
}
|
||||
|
||||
atoms = PropGetCheckProperty(win, _XA_OL_DECOR_ADD, XA_ATOM, 32, 0,
|
||||
&count);
|
||||
atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_ADD, XA_ATOM, 32, 0,
|
||||
&count);
|
||||
if (atoms) {
|
||||
for (i=0; i < count; i++) {
|
||||
if (atoms[i] == _XA_CLOSE)
|
||||
@@ -229,8 +232,8 @@ applyDecorationHints(Window win, int *flags)
|
||||
XFree(atoms);
|
||||
}
|
||||
|
||||
atoms = PropGetCheckProperty(win, _XA_OL_DECOR_DEL, XA_ATOM, 32, 0,
|
||||
&count);
|
||||
atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_DEL, XA_ATOM, 32, 0,
|
||||
&count);
|
||||
if (atoms) {
|
||||
for (i=0; i < count; i++) {
|
||||
if (atoms[i] == _XA_CLOSE)
|
||||
@@ -266,6 +269,20 @@ wOLWMInitStuff(WScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wOLWMChangePushpinState(WWindow *wwin, Bool state)
|
||||
{
|
||||
static Atom pinState = 0;
|
||||
|
||||
if (!pinState) {
|
||||
pinState = XInternAtom(dpy, "_OL_PIN_STATE", False);
|
||||
}
|
||||
|
||||
XChangeProperty(dpy, wwin->client_win, pinState, XA_INTEGER, 32,
|
||||
PropModeReplace, (unsigned char *)&state, 1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wOLWMShutdown(WScreen *scr)
|
||||
{
|
||||
@@ -273,13 +290,30 @@ wOLWMShutdown(WScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
#ifdef unfinished
|
||||
void
|
||||
wOLWMUpdateWindowState(WWindow *wwin)
|
||||
{
|
||||
if (wwin->ol_window_state.used) {
|
||||
if (wwin->ol_window_state.semantic) {
|
||||
if (wwin->ol_window_state.semantic_compose)
|
||||
setComposeLed(True);
|
||||
else
|
||||
setComposeLed(False);
|
||||
}
|
||||
} else {
|
||||
setComposeLed(False);
|
||||
}
|
||||
}
|
||||
#endif /* unfinished */
|
||||
|
||||
void
|
||||
wOLWMCheckClientHints(WWindow *wwin)
|
||||
{
|
||||
OLHints hints;
|
||||
static Atom WT_BASE = 0, WT_CMD, WT_NOTICE, WT_HELP, WT_OTHER;
|
||||
static Atom MT_FULL, MT_LIMITED, MT_NONE;
|
||||
int decorations;
|
||||
int decoration;
|
||||
int pinInitState = OL_PIN_IN;
|
||||
Atom menuType;
|
||||
|
||||
@@ -300,7 +334,7 @@ wOLWMCheckClientHints(WWindow *wwin)
|
||||
if (!getWindowHints(wwin->client_win, &hints) ||
|
||||
!(hints.flags & OL_WINTYPE)) {
|
||||
|
||||
decorations = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|
||||
decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|
||||
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
|
||||
|
||||
menuType = MT_FULL;
|
||||
@@ -308,32 +342,32 @@ wOLWMCheckClientHints(WWindow *wwin)
|
||||
} else {
|
||||
if (hints.winType == WT_BASE) {
|
||||
|
||||
decorations = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|
||||
decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|
||||
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
|
||||
|
||||
menuType = MT_FULL;
|
||||
|
||||
} else if (hints.winType == WT_CMD) {
|
||||
|
||||
decorations = OL_DECORATION_PUSHPIN|OL_DECORATION_RESIZEABLE
|
||||
decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_RESIZEABLE
|
||||
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
|
||||
|
||||
menuType = MT_LIMITED;
|
||||
|
||||
} else if (hints.winType == WT_NOTICE) {
|
||||
|
||||
decorations = OL_DECORATION_ICONNAME;
|
||||
decoration = OL_DECORATION_ICONNAME;
|
||||
menuType = MT_NONE;
|
||||
|
||||
} else if (hints.winType == WT_HELP) {
|
||||
|
||||
decorations = OL_DECORATION_PUSHPIN|OL_DECORATION_HEADER
|
||||
decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_HEADER
|
||||
|OL_DECORATION_ICONNAME|OL_DECORATION_WARPTOPIN;
|
||||
menuType = MT_LIMITED;
|
||||
|
||||
} else if (hints.winType == WT_OTHER) {
|
||||
|
||||
decorations = OL_DECORATION_ICONNAME;
|
||||
decoration = OL_DECORATION_ICONNAME;
|
||||
menuType = MT_NONE;
|
||||
|
||||
if (hints.flags & OL_MENUTYPE) {
|
||||
@@ -365,20 +399,35 @@ wOLWMCheckClientHints(WWindow *wwin)
|
||||
else
|
||||
wwin->flags.olwm_limit_menu = 1;
|
||||
|
||||
/* this is a transient-like window */
|
||||
if (hints.winType == WT_CMD) {
|
||||
wwin->client_flags.olwm_transient = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Emulate olwm pushpin.
|
||||
* Emulate olwm pushpin.
|
||||
* If the initial state of the pin is in, then put the normal close
|
||||
* button. If not, make the close button different and when the
|
||||
* user moves the window or clicks in the close button, turn it
|
||||
* into a normal close button.
|
||||
*/
|
||||
if ((decoration & OL_DECORATION_PUSHPIN) && pinInitState==OL_PIN_OUT) {
|
||||
wwin->flags.olwm_push_pin = 1;
|
||||
wwin->flags.olwm_push_pin_out = 1;
|
||||
|
||||
wOLWMChangePushpinState(wwin, False);
|
||||
} else {
|
||||
wOLWMChangePushpinState(wwin, True);
|
||||
}
|
||||
|
||||
if (!(decoration & OL_DECORATION_RESIZEABLE)) {
|
||||
wwin->client_flags.no_resizable = 1;
|
||||
wwin->client_flags.no_resizebar = 1;
|
||||
}
|
||||
|
||||
if (decoration & OL_DECORATION_WARPTOPIN) {
|
||||
wwin->client_flags.olwm_warp_to_pin = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+7
-1
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Window Maker window manager
|
||||
*
|
||||
* Copyright (c) 1998 Alfredo K. Kojima
|
||||
* Copyright (c) 1998, 1999 Alfredo K. Kojima
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,13 @@
|
||||
#define _OPENLOOK_H_
|
||||
|
||||
|
||||
void wOLWMInitStuff(WScreen *scr);
|
||||
|
||||
void wOLWMShutdown(WScreen *scr);
|
||||
|
||||
void wOLWMCheckClientHints(WWindow *wwin);
|
||||
|
||||
void wOLWMChangePushpinState(WWindow *wwin, Bool state);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+12
-7
@@ -40,7 +40,7 @@ extern Atom _XA_WM_CLIENT_LEADER;
|
||||
extern Atom _XA_WM_TAKE_FOCUS;
|
||||
extern Atom _XA_WM_DELETE_WINDOW;
|
||||
extern Atom _XA_WM_SAVE_YOURSELF;
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
extern Atom _XA_WM_WINDOW_ROLE;
|
||||
extern Atom _XA_SM_CLIENT_ID;
|
||||
#endif
|
||||
@@ -52,7 +52,7 @@ extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_MENU;
|
||||
extern Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
|
||||
extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
|
||||
int
|
||||
PropGetNormalHints(Window window, XSizeHints *size_hints, int *pre_iccm)
|
||||
@@ -126,9 +126,11 @@ PropGetCheckProperty(Window window, Atom hint, Atom type, int format,
|
||||
unsigned long bytes_after_ret;
|
||||
unsigned char *data;
|
||||
int tmp;
|
||||
|
||||
|
||||
if (count <= 0)
|
||||
tmp = 0xffffff;
|
||||
else
|
||||
tmp = count;
|
||||
|
||||
if (XGetWindowProperty(dpy, window, hint, 0, tmp, False, type,
|
||||
&type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret,
|
||||
@@ -186,11 +188,12 @@ PropGetGNUstepWMAttr(Window window, GNUstepWMAttributes **attr)
|
||||
void
|
||||
PropSetWMakerProtocols(Window root)
|
||||
{
|
||||
Atom protocols[2];
|
||||
Atom protocols[3];
|
||||
int count=0;
|
||||
|
||||
protocols[count++] = _XA_WINDOWMAKER_MENU;
|
||||
protocols[count++] = _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
protocols[count++] = _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
|
||||
XChangeProperty(dpy, root, _XA_WINDOWMAKER_WM_PROTOCOLS, XA_ATOM,
|
||||
32, PropModeReplace, (unsigned char *)protocols, count);
|
||||
@@ -216,7 +219,7 @@ PropGetClientLeader(Window window)
|
||||
}
|
||||
|
||||
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
char*
|
||||
PropGetClientID(Window window)
|
||||
{
|
||||
@@ -265,7 +268,7 @@ PropGetWindowRole(Window window)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif /* R6SM */
|
||||
#endif /* XSMP_ENABLED */
|
||||
|
||||
|
||||
void
|
||||
@@ -292,7 +295,9 @@ void
|
||||
PropCleanUp(Window root)
|
||||
{
|
||||
XDeleteProperty(dpy, root, _XA_WINDOWMAKER_WM_PROTOCOLS);
|
||||
|
||||
|
||||
XDeleteProperty(dpy, root, _XA_WINDOWMAKER_NOTICEBOARD);
|
||||
|
||||
XDeleteProperty(dpy, root, XA_WM_ICON_SIZE);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ void PropCleanUp(Window root);
|
||||
|
||||
Window PropGetClientLeader(Window window);
|
||||
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
char *PropGetClientID(Window window);
|
||||
#endif
|
||||
|
||||
|
||||
+3
-3
@@ -132,11 +132,11 @@ wFreeFont(WFont *font)
|
||||
int
|
||||
wGetColor(WScreen *scr, char *color_name, XColor *color)
|
||||
{
|
||||
if (!XParseColor(dpy, scr->colormap, color_name, color)) {
|
||||
if (!XParseColor(dpy, scr->w_colormap, color_name, color)) {
|
||||
wwarning(_("could not parse color \"%s\""), color_name);
|
||||
return False;
|
||||
}
|
||||
if (!XAllocColor(dpy, scr->colormap, color)) {
|
||||
if (!XAllocColor(dpy, scr->w_colormap, color)) {
|
||||
wwarning(_("could not allocate color \"%s\""), color_name);
|
||||
return False;
|
||||
}
|
||||
@@ -151,6 +151,6 @@ wFreeColor(WScreen *scr, unsigned long pixel)
|
||||
unsigned long colors[1];
|
||||
|
||||
colors[0] = pixel;
|
||||
XFreeColors(dpy, scr->colormap, colors, 1, 0);
|
||||
XFreeColors(dpy, scr->w_colormap, colors, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-7
@@ -137,7 +137,8 @@ static Shortcut *shortcutList = NULL;
|
||||
* CLEAR_SESSION is used. If SaveSessionOnExit = Yes; in
|
||||
* WindowMaker domain file, then saving is automatically
|
||||
* done on every windowmaker exit, overwriting any
|
||||
* SAVE_SESSION or CLEAR_SESSION (see below).
|
||||
* SAVE_SESSION or CLEAR_SESSION (see below). Also save
|
||||
* dock state now.
|
||||
* CLEAR_SESSION - clears any previous saved session. This will not have
|
||||
* any effect if SaveSessionOnExit is True.
|
||||
*
|
||||
@@ -181,7 +182,7 @@ exitCommand(WMenu *menu, WMenuEntry *entry)
|
||||
return;
|
||||
inside = 1;
|
||||
|
||||
if ((int)entry->clientdata==M_QUICK
|
||||
if ((long)entry->clientdata==M_QUICK
|
||||
|| wMessageDialog(menu->frame->screen_ptr, _("Exit"),
|
||||
_("Exit window manager?"),
|
||||
_("Exit"), _("Cancel"), NULL)==WAPRDefault) {
|
||||
@@ -211,10 +212,10 @@ shutdownCommand(WMenu *menu, WMenuEntry *entry)
|
||||
|
||||
|
||||
result = R_CANCEL;
|
||||
if ((int)entry->clientdata==M_QUICK)
|
||||
if ((long)entry->clientdata==M_QUICK)
|
||||
result = R_CLOSE;
|
||||
else {
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
if (wSessionIsManaged()) {
|
||||
int r;
|
||||
|
||||
@@ -243,11 +244,11 @@ shutdownCommand(WMenu *menu, WMenuEntry *entry)
|
||||
}
|
||||
|
||||
if (result!=R_CANCEL) {
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
if (result == R_CLOSE) {
|
||||
Shutdown(WSLogoutMode);
|
||||
} else
|
||||
#endif /* R6SM */
|
||||
#endif /* XSMP_ENABLED */
|
||||
{
|
||||
Shutdown(WSKillMode);
|
||||
}
|
||||
@@ -296,7 +297,10 @@ hideOthersCommand(WMenu *menu, WMenuEntry *entry)
|
||||
static void
|
||||
saveSessionCommand(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
wSessionSaveState(menu->frame->screen_ptr);
|
||||
if (!wPreferences.save_session_on_exit)
|
||||
wSessionSaveState(menu->frame->screen_ptr);
|
||||
|
||||
wScreenSaveState(menu->frame->screen_ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+103
-5
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#ifdef SHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
@@ -49,10 +50,13 @@
|
||||
#include "session.h"
|
||||
#include "balloon.h"
|
||||
#ifdef KWM_HINTS
|
||||
#include "kwm.h"
|
||||
# include "kwm.h"
|
||||
#endif
|
||||
#ifdef GNOME_STUFF
|
||||
#include "gnome.h"
|
||||
# include "gnome.h"
|
||||
#endif
|
||||
#ifdef OLWM_HINTS
|
||||
# include "openlook.h"
|
||||
#endif
|
||||
|
||||
#include <proplist.h>
|
||||
@@ -76,6 +80,7 @@
|
||||
extern Cursor wCursor[WCUR_LAST];
|
||||
extern WPreferences wPreferences;
|
||||
extern Atom _XA_WINDOWMAKER_STATE;
|
||||
extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
|
||||
|
||||
extern int wScreenCount;
|
||||
@@ -511,16 +516,24 @@ createInternalWindows(WScreen *scr)
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, wPreferences.icon_size,
|
||||
wPreferences.icon_size, 0, scr->w_depth, CopyFromParent,
|
||||
scr->w_visual, vmask, &attribs);
|
||||
|
||||
|
||||
/* workspace name balloon for clip */
|
||||
vmask = CWBackPixel|CWSaveUnder|CWOverrideRedirect|CWColormap;
|
||||
vmask = CWBackPixel|CWSaveUnder|CWOverrideRedirect|CWColormap
|
||||
|CWBorderPixel;
|
||||
attribs.save_under = True;
|
||||
attribs.override_redirect = True;
|
||||
attribs.colormap = scr->w_colormap;
|
||||
attribs.background_pixel = scr->icon_back_texture->normal.pixel;
|
||||
attribs.border_pixel = 0; /* do not care */
|
||||
scr->clip_balloon =
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, scr->w_depth,
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, scr->w_depth,
|
||||
CopyFromParent, scr->w_visual, vmask, &attribs);
|
||||
|
||||
/* for our window manager info notice board */
|
||||
scr->info_window =
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, CopyFromParent,
|
||||
CopyFromParent, CopyFromParent, 0, NULL);
|
||||
|
||||
/*
|
||||
* If the window is clicked without having ButtonPress selected, the
|
||||
* resulting event will have event.xbutton.window == root.
|
||||
@@ -529,6 +542,69 @@ createInternalWindows(WScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static Bool
|
||||
aquireManagerSelection(WScreen *scr)
|
||||
{
|
||||
char buffer[32];
|
||||
XEvent ev;
|
||||
Time timestamp;
|
||||
|
||||
sprintf(buffer, "WM_S%i", scr->screen);
|
||||
scr->managerAtom = XInternAtom(dpy, buffer, False);
|
||||
|
||||
/* for race-conditions... */
|
||||
XGrabServer(dpy);
|
||||
|
||||
/* if there is another manager running, don't try to replace it
|
||||
* (for now, at least) */
|
||||
if (XGetSelectionOwner(dpy, scr->managerAtom) != None) {
|
||||
XUngrabServer(dpy);
|
||||
return False;
|
||||
}
|
||||
|
||||
/* become the manager for this screen */
|
||||
|
||||
scr->managerWindow = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 1, 1,
|
||||
0, 0, 0);
|
||||
|
||||
XSelectInput(dpy, scr->managerWindow, PropertyChangeMask);
|
||||
/* get a timestamp */
|
||||
XChangeProperty(dpy, scr->managerWindow, scr->managerAtom,
|
||||
XA_INTEGER, 32, PropModeAppend, NULL, 0);
|
||||
while (1) {
|
||||
XWindowEvent(dpy, scr->managerWindow, &ev);
|
||||
if (ev.type == PropertyNotify) {
|
||||
timestamp = ev.xproperty.time;
|
||||
break;
|
||||
}
|
||||
}
|
||||
XSelectInput(dpy, scr->managerWindow, NoEvents);
|
||||
XDeleteProperty(dpy, scr->managerWindow, scr->managerAtom);
|
||||
|
||||
XSetSelectionOwner(dpy, scr->managerAtom, scr->managerWindow, CurrentTime);
|
||||
|
||||
XUngrabServer(dpy);
|
||||
|
||||
/* announce our arrival */
|
||||
|
||||
ev.xclient.type = ClientMessage;
|
||||
ev.xclient.message_type = XInternAtom(dpy, "MANAGER", False);
|
||||
ev.xclient.destination = scr->root_win;
|
||||
ev.xclient.format = 32;
|
||||
ev.xclient.data.l[0] = timestamp;
|
||||
ev.xclient.data.l[1] = scr->managerAtom;
|
||||
ev.xclient.data.l[2] = scr->managerWindow;
|
||||
ev.xclient.data.l[3] = 0;
|
||||
ev.xclient.data.l[4] = 0;
|
||||
|
||||
XSendEvent(dpy, scr->root_win, False, StructureNotify, &ev);
|
||||
XSync(dpy, False);
|
||||
|
||||
return True;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wScreenInit--
|
||||
@@ -575,6 +651,13 @@ wScreenInit(int screen_number)
|
||||
scr->totalUsableArea.x2 = scr->scr_width;
|
||||
scr->totalUsableArea.y2 = scr->scr_height;
|
||||
|
||||
#if 0
|
||||
if (!aquireManagerSelection(scr)) {
|
||||
free(scr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
CantManageScreen = 0;
|
||||
oldHandler = XSetErrorHandler((XErrorHandler)alreadyRunningError);
|
||||
|
||||
@@ -677,6 +760,10 @@ wScreenInit(int screen_number)
|
||||
wGNOMEInitStuff(scr);
|
||||
#endif
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
wOLWMInitStuff(scr);
|
||||
#endif
|
||||
|
||||
/* create initial workspace */
|
||||
wWorkspaceNew(scr);
|
||||
|
||||
@@ -695,6 +782,15 @@ wScreenInit(int screen_number)
|
||||
/* setup WindowMaker protocols property in the root window*/
|
||||
PropSetWMakerProtocols(scr->root_win);
|
||||
|
||||
/* setup our noticeboard */
|
||||
XChangeProperty(dpy, scr->info_window, _XA_WINDOWMAKER_NOTICEBOARD,
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(unsigned char*)&scr->info_window, 1);
|
||||
XChangeProperty(dpy, scr->root_win, _XA_WINDOWMAKER_NOTICEBOARD,
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(unsigned char*)&scr->info_window, 1);
|
||||
|
||||
|
||||
#ifdef BALLOON_TEXT
|
||||
/* initialize balloon text stuff */
|
||||
wBalloonInitialize(scr);
|
||||
@@ -819,6 +915,7 @@ wScreenUpdateUsableArea(WScreen *scr)
|
||||
scr->totalUsableArea.y1 = scr->usableArea.y1;
|
||||
}
|
||||
|
||||
#ifdef not_used
|
||||
#ifdef KWM_HINTS
|
||||
{
|
||||
int i;
|
||||
@@ -828,6 +925,7 @@ wScreenUpdateUsableArea(WScreen *scr)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+13
-2
@@ -68,7 +68,13 @@ typedef struct WReservedArea {
|
||||
*/
|
||||
typedef struct _WScreen {
|
||||
int screen; /* screen number */
|
||||
|
||||
|
||||
#if 0
|
||||
Atom managerAtom; /* WM_Sn atom for manager selection */
|
||||
Window managerWindow; /* window for manager selection */
|
||||
#endif
|
||||
Window info_window; /* for our window manager info stuff */
|
||||
|
||||
int scr_width; /* size of the screen */
|
||||
int scr_height;
|
||||
|
||||
@@ -86,7 +92,7 @@ typedef struct _WScreen {
|
||||
Visual *w_visual;
|
||||
int w_depth;
|
||||
Colormap w_colormap; /* our colormap */
|
||||
|
||||
|
||||
Window no_focus_win; /* window to get focus when nobody
|
||||
* else can do it */
|
||||
|
||||
@@ -150,8 +156,13 @@ typedef struct _WScreen {
|
||||
WMPixel select_pixel;
|
||||
WMPixel select_text_pixel;
|
||||
/* foreground colors */
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
WMPixel window_title_pixel[6];
|
||||
WMPixel menu_title_pixel[6]; /* menu titlebar text */
|
||||
#else /* !TITLE_TEXT_SHADOW */
|
||||
WMPixel window_title_pixel[3]; /* window titlebar text (foc, unfoc, pfoc)*/
|
||||
WMPixel menu_title_pixel[3]; /* menu titlebar text */
|
||||
#endif /* !TITLE_TEXT_SHADOW */
|
||||
WMPixel clip_title_pixel[2]; /* clip title text */
|
||||
WMPixel mtext_pixel; /* menu item text */
|
||||
WMPixel dtext_pixel; /* disabled menu item text */
|
||||
|
||||
+134
-8
@@ -1,7 +1,7 @@
|
||||
/* session.c - session state handling and R6 style session management
|
||||
*
|
||||
* Copyright (c) 1998 Dan Pascu
|
||||
* Copyright (c) 1998 Alfredo Kojima
|
||||
* Copyright (c) 1998, 1999 Alfredo Kojima
|
||||
*
|
||||
* Window Maker window manager
|
||||
*
|
||||
@@ -21,12 +21,50 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* If defined(XSMP_ENABLED) and session manager is running then
|
||||
* do normal stuff
|
||||
* else
|
||||
* do pre-R6 session management stuff (save window state and relaunch)
|
||||
*
|
||||
* When doing a checkpoint:
|
||||
*
|
||||
* = Without XSMP
|
||||
* Open "Stop"/status Dialog
|
||||
* Send SAVE_YOURSELF to clients and wait for reply
|
||||
* Save restart info
|
||||
* Save state of clients
|
||||
*
|
||||
* = With XSMP
|
||||
* Send checkpoint request to sm
|
||||
*
|
||||
* When exiting:
|
||||
* -------------
|
||||
*
|
||||
* = Without XSMP
|
||||
*
|
||||
* Open "Exit Now"/status Dialog
|
||||
* Send SAVE_YOURSELF to clients and wait for reply
|
||||
* Save restart info
|
||||
* Save state of clients
|
||||
* Send DELETE to all clients
|
||||
* When no more clients are left or user hit "Exit Now", exit
|
||||
*
|
||||
* = With XSMP
|
||||
*
|
||||
* Send Shutdown request to session manager
|
||||
* if SaveYourself message received, save state of clients
|
||||
* if the Die message is received, exit.
|
||||
*/
|
||||
|
||||
#include "wconfig.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
#include <X11/SM/SMlib.h>
|
||||
#endif
|
||||
|
||||
@@ -40,6 +78,7 @@
|
||||
#include "WindowMaker.h"
|
||||
#include "screen.h"
|
||||
#include "window.h"
|
||||
#include "client.h"
|
||||
#include "session.h"
|
||||
#include "wcore.h"
|
||||
#include "framewin.h"
|
||||
@@ -56,8 +95,13 @@
|
||||
|
||||
#include <proplist.h>
|
||||
|
||||
/** Global **/
|
||||
|
||||
#ifdef R6SM
|
||||
extern Atom _XA_WM_SAVE_YOURSELF;
|
||||
|
||||
extern Time LastTimestamp;
|
||||
|
||||
#ifdef XSMP_ENABLED
|
||||
|
||||
extern int wScreenCount;
|
||||
|
||||
@@ -528,8 +572,89 @@ wSessionRestoreLastWorkspace(WScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
clearWaitingAckState(WScreen *scr)
|
||||
{
|
||||
WWindow *wwin;
|
||||
WApplication *wapp;
|
||||
|
||||
#ifdef R6SM
|
||||
for (wwin = scr->focused_window; wwin != NULL; wwin = wwin->prev) {
|
||||
wwin->flags.waiting_save_ack = 0;
|
||||
if (wwin->main_window != None) {
|
||||
wapp = wApplicationOf(wwin->main_window);
|
||||
if (wapp)
|
||||
wapp->main_window_desc->flags.waiting_save_ack = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wSessionSaveClients(WScreen *scr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* With XSMP, this job is done by smproxy
|
||||
*/
|
||||
void
|
||||
wSessionSendSaveYourself(WScreen *scr)
|
||||
{
|
||||
WWindow *wwin;
|
||||
int count;
|
||||
|
||||
/* freeze client interaction with clients */
|
||||
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync,
|
||||
CurrentTime);
|
||||
XGrabPointer(dpy, scr->root_win, False, ButtonPressMask|ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, scr->root_win, None,
|
||||
CurrentTime);
|
||||
|
||||
clearWaitingAckState(scr);
|
||||
|
||||
count = 0;
|
||||
|
||||
/* first send SAVE_YOURSELF for everybody */
|
||||
for (wwin = scr->focused_window; wwin != NULL; wwin = wwin->prev) {
|
||||
WWindow *mainWin;
|
||||
|
||||
mainWin = wWindowFor(wwin->main_window);
|
||||
|
||||
if (mainWin) {
|
||||
/* if the client is a multi-window client, only send message
|
||||
* to the main window */
|
||||
wwin = mainWin;
|
||||
}
|
||||
|
||||
/* make sure the SAVE_YOURSELF flag is up-to-date */
|
||||
PropGetProtocols(wwin->client_win, &wwin->protocols);
|
||||
|
||||
if (wwin->protocols.SAVE_YOURSELF) {
|
||||
if (!wwin->flags.waiting_save_ack) {
|
||||
wClientSendProtocol(wwin, _XA_WM_SAVE_YOURSELF, LastTimestamp);
|
||||
|
||||
wwin->flags.waiting_save_ack = 1;
|
||||
count++;
|
||||
}
|
||||
} else {
|
||||
wwin->flags.waiting_save_ack = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* then wait for acknowledge */
|
||||
while (count > 0) {
|
||||
|
||||
}
|
||||
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
XFlush(dpy);
|
||||
}
|
||||
|
||||
|
||||
#ifdef XSMP_ENABLED
|
||||
/*
|
||||
* With full session management support, the part of WMState
|
||||
* that store client window state will become obsolete (maybe we can reuse
|
||||
@@ -548,7 +673,7 @@ wSessionRestoreLastWorkspace(WScreen *scr)
|
||||
* The old session code will become obsolete. When wmaker is
|
||||
* compiled with R6 sm support compiled in, itll be better to
|
||||
* use a totally rewritten state saving code, but we can keep
|
||||
* the current code for when R6SM is not compiled in.
|
||||
* the current code for when XSMP_ENABLED is not compiled in.
|
||||
*
|
||||
* This will be confusing to old users (well get lots of "SAVE_SESSION broke!"
|
||||
* messages), but itll be better.
|
||||
@@ -803,8 +928,8 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
|
||||
|
||||
{
|
||||
proplist_t statefile;
|
||||
|
||||
statefile = PLMakeDictionaryFromEntries(PLMakeString("Version"),
|
||||
|
||||
statefile = PLMakeDictionaryFromEntries(PLMakeString("Version"),
|
||||
PLMakeString("1.0"),
|
||||
|
||||
PLMakeString("Screens"),
|
||||
@@ -1107,10 +1232,11 @@ wSessionRequestShutdown(void)
|
||||
False, True);
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
wSessionIsManaged(void)
|
||||
{
|
||||
return sSMCConn!=NULL;
|
||||
}
|
||||
|
||||
#endif /* !R6SM */
|
||||
#endif /* !XSMP_ENABLED */
|
||||
|
||||
+5
-1
@@ -25,13 +25,17 @@
|
||||
|
||||
void wSessionSaveState(WScreen *scr);
|
||||
|
||||
void wSessionSaveClients(WScreen *scr);
|
||||
|
||||
void wSessionSendSaveYourself(WScreen *scr);
|
||||
|
||||
void wSessionClearState(WScreen *scr);
|
||||
|
||||
void wSessionRestoreState(WScreen *scr);
|
||||
|
||||
void wSessionRestoreLastWorkspace(WScreen *scr);
|
||||
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
void wSessionConnectManager(char **argv, int argc);
|
||||
|
||||
void wSessionDisconnectManager(void);
|
||||
|
||||
+38
-28
@@ -36,7 +36,10 @@
|
||||
#include "properties.h"
|
||||
#include "winspector.h"
|
||||
#ifdef KWM_HINTS
|
||||
#include "kwm.h"
|
||||
# include "kwm.h"
|
||||
#endif
|
||||
#ifdef OLWM_HINTS
|
||||
# include "openlook.h"
|
||||
#endif
|
||||
|
||||
extern Atom _XA_WM_DELETE_WINDOW;
|
||||
@@ -63,49 +66,53 @@ Shutdown(WShutdownMode mode)
|
||||
int i;
|
||||
|
||||
switch (mode) {
|
||||
case WSExitMode:
|
||||
for (i=0; i<wScreenCount; i++) {
|
||||
WScreen *scr;
|
||||
|
||||
scr = wScreenWithNumber(i);
|
||||
if (scr) {
|
||||
if (scr->helper_pid)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr, True);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
RestoreDesktop(scr);
|
||||
}
|
||||
}
|
||||
|
||||
ExecExitScript();
|
||||
Exit(0);
|
||||
break;
|
||||
|
||||
case WSLogoutMode:
|
||||
#ifdef R6SM
|
||||
#ifdef XSMP_ENABLED
|
||||
wSessionRequestShutdown();
|
||||
break;
|
||||
#else
|
||||
/* fall through */
|
||||
#endif
|
||||
case WSKillMode:
|
||||
for (i=0; i<wScreenCount; i++) {
|
||||
case WSExitMode:
|
||||
/* if there is no session manager, send SAVE_YOURSELF to
|
||||
* the clients */
|
||||
#if 0
|
||||
#ifdef XSMP_ENABLED
|
||||
if (!wSessionIsManaged())
|
||||
#endif
|
||||
for (i = 0; i < wScreenCount; i++) {
|
||||
WScreen *scr;
|
||||
|
||||
scr = wScreenWithNumber(i);
|
||||
if (scr) {
|
||||
wSessionSendSaveYourself(scr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < wScreenCount; i++) {
|
||||
WScreen *scr;
|
||||
|
||||
|
||||
scr = wScreenWithNumber(i);
|
||||
if (scr) {
|
||||
if (scr->helper_pid)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
|
||||
/* if the session is not being managed, save restart info */
|
||||
#ifdef XSMP_ENABLED
|
||||
if (!wSessionIsManaged())
|
||||
#endif
|
||||
wSessionSaveClients(scr);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr, True);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
wipeDesktop(scr);
|
||||
if (mode == WSKillMode)
|
||||
wipeDesktop(scr);
|
||||
else
|
||||
RestoreDesktop(scr);
|
||||
}
|
||||
}
|
||||
ExecExitScript();
|
||||
@@ -122,6 +129,9 @@ Shutdown(WShutdownMode mode)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr, False);
|
||||
#endif
|
||||
#ifdef OLWM_HINTS
|
||||
wOLWMShutdown(scr);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
@@ -179,7 +189,7 @@ RestoreDesktop(WScreen *scr)
|
||||
if (core->descriptor.parent_type==WCLASS_WINDOW) {
|
||||
wwin = core->descriptor.parent;
|
||||
wwin->flags.mapped=1;
|
||||
wUnmanageWindow(wwin, !wwin->flags.internal_window);
|
||||
wUnmanageWindow(wwin, !wwin->flags.internal_window, False);
|
||||
}
|
||||
core = next;
|
||||
}
|
||||
|
||||
+73
-11
@@ -151,6 +151,10 @@ CommitStacking(WScreen *scr)
|
||||
}
|
||||
XRestackWindows(dpy, windows, i);
|
||||
free(windows);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wKWMBroadcastStacking(scr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -173,6 +177,10 @@ 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
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -192,7 +200,7 @@ moveFrameToUnder(WCoreWindow *under, WCoreWindow *frame)
|
||||
void
|
||||
wRaiseFrame(WCoreWindow *frame)
|
||||
{
|
||||
WCoreWindow *wlist=frame;
|
||||
WCoreWindow *wlist = frame, *wlist_above;
|
||||
int level = frame->stacking->window_level;
|
||||
int i;
|
||||
|
||||
@@ -202,9 +210,19 @@ wRaiseFrame(WCoreWindow *frame)
|
||||
}
|
||||
|
||||
/* insert on top of other windows */
|
||||
#if 1
|
||||
while (wlist) {
|
||||
if (wlist == (wlist_above = wlist->stacking->above)) {
|
||||
wwarning("You just found a bug in wmaker. Please try to figure what type of raising/lowering operations you did with which applications and report. Please give complete information about how to reproduce it.");
|
||||
break;
|
||||
} else {
|
||||
wlist=wlist_above;
|
||||
}
|
||||
}
|
||||
#else
|
||||
while (wlist)
|
||||
wlist = wlist->stacking->above;
|
||||
|
||||
#endif
|
||||
/* window is inserted before the point found */
|
||||
if (wlist==NULL) {
|
||||
/* top most window (last on the list) */
|
||||
@@ -229,7 +247,10 @@ wRaiseFrame(WCoreWindow *frame)
|
||||
wlist->stacking->under->stacking->above = frame;
|
||||
wlist->stacking->under = frame;
|
||||
}
|
||||
if (wPreferences.on_top_transients) {
|
||||
#ifdef removed
|
||||
if (wPreferences.on_top_transients)
|
||||
#endif
|
||||
{
|
||||
/* raise transients under us from bottom to top
|
||||
* so that the order is kept */
|
||||
again:
|
||||
@@ -287,15 +308,38 @@ wRaiseFrame(WCoreWindow *frame)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wRaiseLowerFrame(WCoreWindow *frame)
|
||||
{
|
||||
if (!frame->stacking->above
|
||||
||(frame->stacking->window_level
|
||||
!=frame->stacking->above->stacking->window_level))
|
||||
wLowerFrame(frame);
|
||||
else
|
||||
wRaiseFrame(frame);
|
||||
!=frame->stacking->above->stacking->window_level)) {
|
||||
|
||||
wLowerFrame(frame);
|
||||
} else {
|
||||
WCoreWindow *scan = frame->stacking->above;
|
||||
WWindow *frame_wwin = (WWindow*) frame->descriptor.parent;
|
||||
|
||||
while (scan) {
|
||||
|
||||
if (scan->descriptor.parent_type == WCLASS_WINDOW) {
|
||||
WWindow *scan_wwin = (WWindow*) scan->descriptor.parent;
|
||||
|
||||
if (wWindowObscuresWindow(scan_wwin, frame_wwin)
|
||||
&& scan_wwin->flags.mapped) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
scan = scan->stacking->above;
|
||||
}
|
||||
|
||||
if (scan) {
|
||||
wRaiseFrame(frame);
|
||||
} else {
|
||||
wLowerFrame(frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -311,10 +355,16 @@ wLowerFrame(WCoreWindow *frame)
|
||||
if (wlist->stacking->under==NULL) {
|
||||
return;
|
||||
}
|
||||
#ifdef removed
|
||||
if (wPreferences.on_top_transients &&
|
||||
wlist->stacking->under==wlist->stacking->child_of) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (wlist->stacking->under==wlist->stacking->child_of) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
prev = wlist;
|
||||
/* remove from the list */
|
||||
if (scr->stacking_list[level] == frame) {
|
||||
@@ -329,7 +379,10 @@ wLowerFrame(WCoreWindow *frame)
|
||||
}
|
||||
wlist = scr->stacking_list[level];
|
||||
/* look for place to put this window */
|
||||
if (wPreferences.on_top_transients) {
|
||||
#ifdef removed
|
||||
if (wPreferences.on_top_transients)
|
||||
#endif
|
||||
{
|
||||
WCoreWindow *owner = frame->stacking->child_of;
|
||||
|
||||
if (owner != wlist) {
|
||||
@@ -341,11 +394,14 @@ wLowerFrame(WCoreWindow *frame)
|
||||
wlist = wlist->stacking->under;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#ifdef removed
|
||||
else {
|
||||
while (wlist->stacking->under) {
|
||||
wlist = wlist->stacking->under;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* insert under the place found */
|
||||
frame->stacking->above = wlist;
|
||||
frame->stacking->under = wlist->stacking->under;
|
||||
@@ -416,7 +472,10 @@ AddToStackList(WCoreWindow *frame)
|
||||
}
|
||||
prev = tmpw;
|
||||
/* check if this is a transient owner */
|
||||
if (wPreferences.on_top_transients) {
|
||||
#ifdef removed
|
||||
if (wPreferences.on_top_transients)
|
||||
#endif
|
||||
{
|
||||
WCoreWindow *trans = NULL;
|
||||
|
||||
wlist = frame->screen_ptr->stacking_list[index];
|
||||
@@ -438,13 +497,16 @@ AddToStackList(WCoreWindow *frame)
|
||||
tmpw->stacking->above = frame;
|
||||
frame->screen_ptr->stacking_list[index] = frame;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#ifdef removed
|
||||
else {
|
||||
/* put on top of the stacking list */
|
||||
frame->stacking->above = NULL;
|
||||
frame->stacking->under = tmpw;
|
||||
tmpw->stacking->above = frame;
|
||||
frame->screen_ptr->stacking_list[index] = frame;
|
||||
}
|
||||
#endif
|
||||
CommitStacking(frame->screen_ptr);
|
||||
}
|
||||
|
||||
|
||||
+19
-10
@@ -117,6 +117,7 @@ extern Atom _XA_WINDOWMAKER_MENU;
|
||||
extern Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
extern Atom _XA_WINDOWMAKER_STATE;
|
||||
extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
|
||||
@@ -252,7 +253,7 @@ handleSig(int sig)
|
||||
* here. Xlib calls are not reentrant so the integrity of Xlib is
|
||||
* not guaranteed if a Xlib call is made from a signal handler.
|
||||
*/
|
||||
if (sig == SIGHUP) {
|
||||
if (sig == SIGUSR1) {
|
||||
#ifdef SYS_SIGLIST_DECLARED
|
||||
wwarning(_("got signal %i (%s) - restarting\n"), sig, sys_siglist[sig]);
|
||||
#else
|
||||
@@ -269,8 +270,12 @@ handleSig(int sig)
|
||||
WMAddIdleHandler(delayedAction, NULL);
|
||||
}
|
||||
return;
|
||||
} else if (sig == SIGTERM) {
|
||||
printf(_("%s: Received signal SIGTERM. Exiting..."), ProgName);
|
||||
} else if (sig == SIGTERM || sig == SIGHUP) {
|
||||
#ifdef SYS_SIGLIST_DECLARED
|
||||
wwarning(_("got signal %i (%s) - exiting...\n"), sig, sys_siglist[sig]);
|
||||
#else
|
||||
wwarning(_("got signal %i - exiting...\n"), sig);
|
||||
#endif
|
||||
|
||||
WProgramState = WSTATE_NEED_EXIT;
|
||||
|
||||
@@ -550,6 +555,7 @@ wScreenForRootWindow(Window window)
|
||||
}
|
||||
|
||||
assert("bad_root_window" && 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -622,14 +628,16 @@ StartUp(Bool defaultScreenOnly)
|
||||
_XA_WINDOWMAKER_STATE = XInternAtom(dpy, "_WINDOWMAKER_STATE", False);
|
||||
|
||||
_XA_WINDOWMAKER_WM_PROTOCOLS =
|
||||
XInternAtom(dpy, "_WINDOWMAKER_WM_PROTOCOLS", False);
|
||||
XInternAtom(dpy, "_WINDOWMAKER_WM_PROTOCOLS", False);
|
||||
|
||||
_XA_GNUSTEP_WM_MINIATURIZE_WINDOW =
|
||||
XInternAtom(dpy, GNUSTEP_WM_MINIATURIZE_WINDOW, False);
|
||||
XInternAtom(dpy, GNUSTEP_WM_MINIATURIZE_WINDOW, False);
|
||||
|
||||
_XA_WINDOWMAKER_WM_FUNCTION = XInternAtom(dpy, "_WINDOWMAKER_WM_FUNCTION",
|
||||
False);
|
||||
False);
|
||||
|
||||
_XA_WINDOWMAKER_NOTICEBOARD = XInternAtom(dpy, "_WINDOWMAKER_NOTICEBOARD",
|
||||
False);
|
||||
|
||||
#ifdef OFFIX_DND
|
||||
_XA_DND_SELECTION = XInternAtom(dpy, "DndSelection", False);
|
||||
@@ -664,6 +672,7 @@ StartUp(Bool defaultScreenOnly)
|
||||
sig_action.sa_flags = 0;
|
||||
sigaction(SIGINT, &sig_action, NULL);
|
||||
sigaction(SIGTERM, &sig_action, NULL);
|
||||
sigaction(SIGHUP, &sig_action, NULL);
|
||||
sigaction(SIGQUIT, &sig_action, NULL);
|
||||
sigaction(SIGSEGV, &sig_action, NULL);
|
||||
sigaction(SIGBUS, &sig_action, NULL);
|
||||
@@ -672,11 +681,11 @@ StartUp(Bool defaultScreenOnly)
|
||||
sigaction(SIGABRT, &sig_action, NULL);
|
||||
#endif
|
||||
|
||||
/* Here we set SA_RESTART for safety, because SIGHUP may not be handled
|
||||
/* Here we set SA_RESTART for safety, because SIGUSR1 may not be handled
|
||||
* immediately.
|
||||
* -Dan */
|
||||
sig_action.sa_flags = SA_RESTART;
|
||||
sigaction(SIGHUP, &sig_action, NULL);
|
||||
sigaction(SIGUSR1, &sig_action, NULL);
|
||||
|
||||
/* ignore dead pipe */
|
||||
sig_action.sa_handler = ignoreSig;
|
||||
@@ -930,7 +939,6 @@ manageAllWindows(WScreen *scr)
|
||||
XMoveWindow(dpy, children[i], scr->scr_width+10,
|
||||
scr->scr_height+10);
|
||||
}
|
||||
|
||||
wwin = wManageWindow(scr, children[i]);
|
||||
if (wwin) {
|
||||
if (state==WithdrawnState) {
|
||||
@@ -938,7 +946,7 @@ manageAllWindows(WScreen *scr)
|
||||
wClientSetState(wwin, WithdrawnState, None);
|
||||
XSelectInput(dpy, wwin->client_win, NoEventMask);
|
||||
XRemoveFromSaveSet(dpy, wwin->client_win);
|
||||
wUnmanageWindow(wwin, True);
|
||||
wUnmanageWindow(wwin, True, False);
|
||||
} else {
|
||||
/* apply states got from WSavedState */
|
||||
/* shaded + minimized is not restored correctly */
|
||||
@@ -963,6 +971,7 @@ manageAllWindows(WScreen *scr)
|
||||
|| wwin->transient_for==wwin->client_win
|
||||
|| !windowInList(wwin->transient_for,
|
||||
children, nchildren)) {
|
||||
wwin->flags.miniaturized = 0;
|
||||
wIconifyWindow(wwin);
|
||||
wwin->flags.ignore_next_unmap=1;
|
||||
}
|
||||
|
||||
+118
-3
@@ -38,6 +38,8 @@
|
||||
#include "wcore.h"
|
||||
#include "framewin.h"
|
||||
#include "window.h"
|
||||
#include "icon.h"
|
||||
#include "appicon.h"
|
||||
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
@@ -89,8 +91,14 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
RDestroyImage(icon);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<DEMATERIALIZE_STEPS; i++) {
|
||||
XEvent foo;
|
||||
if (XCheckTypedWindowEvent(dpy, scr->root_win, ButtonPressMask,
|
||||
&foo)) {
|
||||
XClearWindow(dpy, scr->root_win);
|
||||
break;
|
||||
}
|
||||
image = RCloneImage(back);
|
||||
RCombineImagesWithOpaqueness(image, icon,
|
||||
(DEMATERIALIZE_STEPS-1-i)*256/(DEMATERIALIZE_STEPS+2));
|
||||
@@ -120,7 +128,8 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
int ll;
|
||||
#endif
|
||||
char pvx[PIECES], pvy[PIECES];
|
||||
char ax[PIECES], ay[PIECES];
|
||||
/* in MkLinux/PPC gcc seems to think that char is unsigned? */
|
||||
signed char ax[PIECES], ay[PIECES];
|
||||
Pixmap tmp;
|
||||
|
||||
XSetClipMask(dpy, scr->copy_gc, None);
|
||||
@@ -171,7 +180,15 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
|
||||
j=k;
|
||||
while (k>0) {
|
||||
for (i=0; i<j; i++) {
|
||||
XEvent foo;
|
||||
|
||||
if (XCheckTypedWindowEvent(dpy, scr->root_win, ButtonPressMask,
|
||||
&foo)) {
|
||||
XClearWindow(dpy, scr->root_win);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<j ; i++) {
|
||||
if (ax[i]>=0) {
|
||||
int _px = px[i]>>KAB_PRECISION;
|
||||
#ifdef ICON_KABOOM_EXTRA
|
||||
@@ -405,3 +422,101 @@ DoWindowBirth(WWindow *wwin)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef SILLYNESS
|
||||
static WMPixmap *data[12];
|
||||
|
||||
|
||||
static Bool
|
||||
loadData(WScreen *scr)
|
||||
{
|
||||
FILE *f;
|
||||
int i;
|
||||
RImage *image;
|
||||
Pixmap d[12];
|
||||
|
||||
f = fopen(PKGDATADIR"/xtree.dat", "r");
|
||||
if (!f)
|
||||
return False;
|
||||
|
||||
image = RCreateImage(50, 50, False);
|
||||
if (!image) {
|
||||
fclose(f);
|
||||
return False;
|
||||
}
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
if (fread(image->data[0], 50*50, 1, f)!=1) {
|
||||
goto error;
|
||||
}
|
||||
if (fread(image->data[1], 50*50, 1, f)!=1) {
|
||||
goto error;
|
||||
}
|
||||
if (fread(image->data[2], 50*50, 1, f)!=1) {
|
||||
goto error;
|
||||
}
|
||||
if (!RConvertImage(scr->rcontext, image, &(d[i]))) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
RDestroyImage(image);
|
||||
|
||||
fclose(f);
|
||||
|
||||
for (i=0; i<12; i++) {
|
||||
data[i] = WMCreatePixmapFromXPixmaps(scr->wmscreen, d[i], None, 50, 50,
|
||||
scr->w_depth);
|
||||
}
|
||||
|
||||
return True;
|
||||
|
||||
error:
|
||||
RDestroyImage(image);
|
||||
|
||||
fclose(f);
|
||||
|
||||
while (--i > 0) {
|
||||
XFreePixmap(dpy, d[i]);
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
WMPixmap*
|
||||
DoXThing(WWindow *wwin)
|
||||
{
|
||||
static int order = 0;
|
||||
|
||||
order++;
|
||||
|
||||
return data[order % 12];
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
InitXThing(WScreen *scr)
|
||||
{
|
||||
time_t t;
|
||||
struct tm *l;
|
||||
static int i = 0;
|
||||
|
||||
if (i)
|
||||
return True;
|
||||
|
||||
t = time(NULL);
|
||||
l = localtime(&t);
|
||||
if ((l->tm_mon!=12||l->tm_mday<24||l->tm_mday>26)) {
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!loadData(scr))
|
||||
return False;
|
||||
|
||||
i = 1;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
#endif /* SILLYNESS */
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ wTextureDestroy(WScreen *scr, WTexture *texture)
|
||||
* to do reference counting for colors. */
|
||||
XSync(dpy,0);
|
||||
oldhandler = XSetErrorHandler(dummyErrorHandler);
|
||||
XFreeColors(dpy, scr->colormap, colors, count, 0);
|
||||
XFreeColors(dpy, scr->w_colormap, colors, count, 0);
|
||||
XSync(dpy,0);
|
||||
XSetErrorHandler(oldhandler);
|
||||
}
|
||||
|
||||
+19
-21
@@ -50,27 +50,13 @@
|
||||
|
||||
/* #define CPP_PATH /lib/cpp */
|
||||
|
||||
/*
|
||||
* Internationalization (I18N) support
|
||||
* Multi-byte (japanese, korean, chinese etc.) character support
|
||||
* set by configure
|
||||
*/
|
||||
#undef I18N_MB
|
||||
|
||||
|
||||
/*
|
||||
* sound support
|
||||
*/
|
||||
#define WMSOUND
|
||||
|
||||
|
||||
/*
|
||||
* support for OffiX DND drag and drop in the Dock
|
||||
*/
|
||||
#define OFFIX_DND
|
||||
|
||||
/*
|
||||
* support for XDE drang and drop in the Dock. still in beta
|
||||
* support for XDE drang and drop in the Dock. Experimental
|
||||
*/
|
||||
#undef XDE_DND
|
||||
|
||||
@@ -123,11 +109,6 @@
|
||||
*/
|
||||
#define NUMLOCK_HACK
|
||||
|
||||
/*
|
||||
* define REDUCE_APPICONS if you want apps with the same WM_INSTANCE &&
|
||||
* WM_CLASS to share an appicon
|
||||
*/
|
||||
#undef REDUCE_APPICONS
|
||||
|
||||
|
||||
/*
|
||||
@@ -164,6 +145,14 @@
|
||||
#undef WS_INDICATOR
|
||||
|
||||
|
||||
/*
|
||||
* Ignores the PPosition hint from clients. This is needed for some
|
||||
* programs that have buggy implementations of such hint and place
|
||||
* themselves in strange locations.
|
||||
*/
|
||||
#undef IGNORE_NOPPOSITION
|
||||
|
||||
|
||||
#define SILLYNESS
|
||||
|
||||
/*
|
||||
@@ -392,7 +381,7 @@
|
||||
#define PLACETEST_VSTEP 8
|
||||
|
||||
|
||||
#define DOCK_EXTRA_SPACE 1
|
||||
#define DOCK_EXTRA_SPACE 0
|
||||
|
||||
/* Vicinity in which an icon can be attached to the clip */
|
||||
#define CLIP_ATTACH_VICINITY 1
|
||||
@@ -443,6 +432,15 @@
|
||||
|
||||
#define FRAME_BORDER_COLOR "black"
|
||||
|
||||
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
#define TITLE_TEXT_SHADOW_X_OFFSET 1
|
||||
#define TITLE_TEXT_SHADOW_Y_OFFSET 1
|
||||
#define TITLE_TEXT_SHADOW_WIDTH 1
|
||||
#define TITLE_TEXT_SHADOW_HEIGHT 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* You should not modify the following values, unless you know
|
||||
|
||||
+19
-21
@@ -50,27 +50,13 @@
|
||||
|
||||
/* #define CPP_PATH @CPP_PATH@ */
|
||||
|
||||
/*
|
||||
* Internationalization (I18N) support
|
||||
* Multi-byte (japanese, korean, chinese etc.) character support
|
||||
* set by configure
|
||||
*/
|
||||
@I18N_MB@
|
||||
|
||||
|
||||
/*
|
||||
* sound support
|
||||
*/
|
||||
@SOUND@
|
||||
|
||||
|
||||
/*
|
||||
* support for OffiX DND drag and drop in the Dock
|
||||
*/
|
||||
#define OFFIX_DND
|
||||
|
||||
/*
|
||||
* support for XDE drang and drop in the Dock. still in beta
|
||||
* support for XDE drang and drop in the Dock. Experimental
|
||||
*/
|
||||
#undef XDE_DND
|
||||
|
||||
@@ -123,11 +109,6 @@
|
||||
*/
|
||||
#define NUMLOCK_HACK
|
||||
|
||||
/*
|
||||
* define REDUCE_APPICONS if you want apps with the same WM_INSTANCE &&
|
||||
* WM_CLASS to share an appicon
|
||||
*/
|
||||
@REDUCE_APPICONS@
|
||||
|
||||
|
||||
/*
|
||||
@@ -164,6 +145,14 @@
|
||||
#undef WS_INDICATOR
|
||||
|
||||
|
||||
/*
|
||||
* Ignores the PPosition hint from clients. This is needed for some
|
||||
* programs that have buggy implementations of such hint and place
|
||||
* themselves in strange locations.
|
||||
*/
|
||||
#undef IGNORE_NOPPOSITION
|
||||
|
||||
|
||||
#define SILLYNESS
|
||||
|
||||
/*
|
||||
@@ -392,7 +381,7 @@
|
||||
#define PLACETEST_VSTEP 8
|
||||
|
||||
|
||||
#define DOCK_EXTRA_SPACE 1
|
||||
#define DOCK_EXTRA_SPACE 0
|
||||
|
||||
/* Vicinity in which an icon can be attached to the clip */
|
||||
#define CLIP_ATTACH_VICINITY 1
|
||||
@@ -443,6 +432,15 @@
|
||||
|
||||
#define FRAME_BORDER_COLOR "black"
|
||||
|
||||
|
||||
#ifdef TITLE_TEXT_SHADOW
|
||||
#define TITLE_TEXT_SHADOW_X_OFFSET 1
|
||||
#define TITLE_TEXT_SHADOW_Y_OFFSET 1
|
||||
#define TITLE_TEXT_SHADOW_WIDTH 1
|
||||
#define TITLE_TEXT_SHADOW_HEIGHT 1
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* You should not modify the following values, unless you know
|
||||
|
||||
+181
-63
@@ -55,13 +55,14 @@
|
||||
#ifdef MWM_HINTS
|
||||
# include "motif.h"
|
||||
#endif
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
#include "kwm.h"
|
||||
# include "kwm.h"
|
||||
#endif
|
||||
|
||||
#ifdef GNOME_STUFF
|
||||
#include "gnome.h"
|
||||
# include "gnome.h"
|
||||
#endif
|
||||
#ifdef OLWM_HINTS
|
||||
# include "openlook.h"
|
||||
#endif
|
||||
|
||||
/****** Global Variables ******/
|
||||
@@ -368,6 +369,10 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
|
||||
wGNOMECheckClientHints(wwin, &tmp_level, &tmp_workspace);
|
||||
#endif /* GNOME_STUFF */
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
wOLWMCheckClientHints(wwin);
|
||||
#endif /* OLWM_HINTS */
|
||||
|
||||
if (tmp_level < 0) {
|
||||
if (WFLAGP(wwin, floating))
|
||||
*level = WMFloatingLevel;
|
||||
@@ -430,24 +435,31 @@ wWindowCanReceiveFocus(WWindow *wwin)
|
||||
return True;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
Bool
|
||||
wWindowObscuresWindow(WWindow *wwin, WWindow *obscured)
|
||||
{
|
||||
int w1, h1, w2, h2;
|
||||
|
||||
w1 = wwin->frame->core->width;
|
||||
h1 = wwin->frame->core->height;
|
||||
w2 = obscured->frame->core->width;
|
||||
h2 = obscured->frame->core->height;
|
||||
|
||||
if (!IS_OMNIPRESENT(wwin) && !IS_OMNIPRESENT(obscured)
|
||||
&& wwin->frame->workspace != obscured->frame->workspace)
|
||||
return False;
|
||||
|
||||
if (wwin->frame_x+wwin->frame->core->width < obscured->frame_x
|
||||
|| wwin->frame_y+wwin->frame->core->height < obscured->frame_y
|
||||
|| wwin->frame_x > obscured->frame_x+obscured->frame->core->width
|
||||
|| wwin->frame_y > obscured->frame_y+obscured->frame->core->height) {
|
||||
if (wwin->frame_x + w1 < obscured->frame_x
|
||||
|| wwin->frame_y + h1 < obscured->frame_y
|
||||
|| wwin->frame_x > obscured->frame_x + w2
|
||||
|| wwin->frame_y > obscured->frame_y + h2) {
|
||||
return False;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -480,6 +492,7 @@ wManageWindow(WScreen *scr, Window window)
|
||||
XWindowAttributes wattribs;
|
||||
XSetWindowAttributes attribs;
|
||||
WWindowState *win_state;
|
||||
WWindow *transientOwner = NULL;
|
||||
int window_level;
|
||||
int foo;
|
||||
int workspace = -1;
|
||||
@@ -595,22 +608,12 @@ wManageWindow(WScreen *scr, Window window)
|
||||
if (wwin->transient_for==None || wwin->transient_for==window) {
|
||||
wwin->transient_for = scr->root_win;
|
||||
} else {
|
||||
WWindow *owner;
|
||||
owner = wWindowFor(wwin->transient_for);
|
||||
if (owner && owner->main_window!=None) {
|
||||
wwin->main_window = owner->main_window;
|
||||
transientOwner = wWindowFor(wwin->transient_for);
|
||||
if (transientOwner && transientOwner->main_window!=None) {
|
||||
wwin->main_window = transientOwner->main_window;
|
||||
} /*else {
|
||||
wwin->main_window = None;
|
||||
}*/
|
||||
|
||||
/* don't let transients start miniaturized if their owners
|
||||
* are not */
|
||||
if (owner && !owner->flags.miniaturized
|
||||
&& wwin->flags.miniaturized) {
|
||||
wwin->flags.miniaturized = 0;
|
||||
if (wwin->wm_hints)
|
||||
wwin->wm_hints->initial_state = NormalState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,9 +636,26 @@ wManageWindow(WScreen *scr, Window window)
|
||||
*--------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
wWindowSetupInitialAttributes(wwin, &window_level, &workspace);
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
if (wwin->client_flags.olwm_transient && wwin->transient_for==None
|
||||
&& wwin->group_id!=None && wwin->group_id != window) {
|
||||
|
||||
transientOwner = wWindowFor(wwin->group_id);
|
||||
|
||||
if (transientOwner) {
|
||||
wwin->transient_for = wwin->group_id;
|
||||
|
||||
/* transients can't be iconified or maximized */
|
||||
if (wwin->transient_for) {
|
||||
WSETUFLAG(wwin, no_miniaturizable, 1);
|
||||
WSETUFLAG(wwin, no_miniaturize_button, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* OLWM_HINTS */
|
||||
|
||||
/*
|
||||
* Make broken apps behave as a nice app.
|
||||
*/
|
||||
@@ -650,11 +670,12 @@ wManageWindow(WScreen *scr, Window window)
|
||||
*
|
||||
*------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (WFLAGP(wwin, start_miniaturized) && !WFLAGP(wwin, no_miniaturizable)) {
|
||||
wwin->flags.miniaturized = 1;
|
||||
}
|
||||
|
||||
if (WFLAGP(wwin, start_maximized)) {
|
||||
if (WFLAGP(wwin, start_maximized) && !WFLAGP(wwin, no_resizable)) {
|
||||
wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL;
|
||||
}
|
||||
|
||||
@@ -710,21 +731,37 @@ wManageWindow(WScreen *scr, Window window)
|
||||
}
|
||||
}
|
||||
|
||||
/* don't let transients start miniaturized if their owners are not */
|
||||
if (transientOwner && !transientOwner->flags.miniaturized
|
||||
&& wwin->flags.miniaturized) {
|
||||
wwin->flags.miniaturized = 0;
|
||||
if (wwin->wm_hints)
|
||||
wwin->wm_hints->initial_state = NormalState;
|
||||
}
|
||||
|
||||
/* set workspace on which the window starts */
|
||||
if (workspace >= 0) {
|
||||
if (workspace > scr->workspace_count-1) {
|
||||
wWorkspaceMake(scr, workspace - scr->workspace_count + 1);
|
||||
workspace = scr->workspace_count - 1;
|
||||
workspace = workspace % scr->workspace_count;
|
||||
}
|
||||
} else {
|
||||
int w;
|
||||
|
||||
w = wDefaultGetStartWorkspace(scr, wwin->wm_instance, wwin->wm_class);
|
||||
|
||||
if (w >= 0 && w < scr->workspace_count && !(IS_OMNIPRESENT(wwin))) {
|
||||
|
||||
workspace = w;
|
||||
|
||||
} else {
|
||||
workspace = scr->current_workspace;
|
||||
if (wPreferences.open_transients_with_parent && transientOwner) {
|
||||
|
||||
workspace = transientOwner->frame->workspace;
|
||||
|
||||
} else {
|
||||
|
||||
workspace = scr->current_workspace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -795,10 +832,18 @@ wManageWindow(WScreen *scr, Window window)
|
||||
foo |= WFF_LEFT_BUTTON;
|
||||
if (foo!=0)
|
||||
wFrameWindowHideButton(wwin->frame, foo);
|
||||
|
||||
|
||||
|
||||
wwin->frame->child = wwin;
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
/* emulate olwm push pin. Make the button look as pushed-in for
|
||||
* the pinned-out state. When the button is clicked, it will
|
||||
* revert to the normal position, which means the pin is pinned-in.
|
||||
*/
|
||||
if (wwin->flags.olwm_push_pin_out)
|
||||
wFrameWindowUpdatePushButton(wwin->frame, True);
|
||||
#endif /* OLWM_HINTS */
|
||||
|
||||
wFrameWindowChangeTitle(wwin->frame, title ? title : DEF_WINDOW_TITLE);
|
||||
if (title)
|
||||
XFree(title);
|
||||
@@ -902,17 +947,22 @@ wManageWindow(WScreen *scr, Window window)
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* if not auto focus, then map the window under the currently
|
||||
* focused window */
|
||||
#define _WIDTH(w) (w)->frame->core->width
|
||||
#define _HEIGHT(w) (w)->frame->core->height
|
||||
if (!wPreferences.auto_focus && scr->focused_window
|
||||
&& !scr->flags.startup
|
||||
&& wWindowObscuresWindow(wwin, scr->focused_window)
|
||||
&& (_WIDTH(wwin) > (_WIDTH(scr->focused_window)*5)/3
|
||||
|| _HEIGHT(wwin) > (_HEIGHT(scr->focused_window)*5)/3)
|
||||
&& WINDOW_LEVEL(scr->focused_window) == WINDOW_LEVEL(wwin)) {
|
||||
MoveInStackListUnder(scr->focused_window->frame->core,
|
||||
wwin->frame->core);
|
||||
}
|
||||
#endif
|
||||
#undef _WIDTH
|
||||
#undef _HEIGHT
|
||||
|
||||
if (wPreferences.superfluous && !wPreferences.no_animations
|
||||
&& !scr->flags.startup && wwin->transient_for==None
|
||||
/*
|
||||
@@ -943,12 +993,12 @@ wManageWindow(WScreen *scr, Window window)
|
||||
}
|
||||
|
||||
/* setup stacking descriptor */
|
||||
if (wPreferences.on_top_transients && wwin->transient_for!=None
|
||||
&& wwin->transient_for!=scr->root_win) {
|
||||
WWindow *tmp;
|
||||
tmp = wWindowFor(wwin->transient_for);
|
||||
if (tmp)
|
||||
wwin->frame->core->stacking->child_of = tmp->frame->core;
|
||||
if (transientOwner) {
|
||||
/* && wPreferences.on_top_transients */
|
||||
if (transientOwner) {
|
||||
wwin->frame->core->stacking->child_of =
|
||||
transientOwner->frame->core;
|
||||
}
|
||||
} else {
|
||||
wwin->frame->core->stacking->child_of = NULL;
|
||||
}
|
||||
@@ -965,7 +1015,7 @@ wManageWindow(WScreen *scr, Window window)
|
||||
/* add window at beginning of focus window list */
|
||||
tmp = scr->focused_window;
|
||||
while (tmp->prev)
|
||||
tmp = tmp->prev;
|
||||
tmp = tmp->prev;
|
||||
tmp->prev = wwin;
|
||||
wwin->next = tmp;
|
||||
wwin->prev = NULL;
|
||||
@@ -994,9 +1044,8 @@ wManageWindow(WScreen *scr, Window window)
|
||||
|
||||
|
||||
if (!wwin->flags.miniaturized && workspace == scr->current_workspace) {
|
||||
WWindow *tmp = wWindowFor(wwin->transient_for);
|
||||
|
||||
if ((tmp && tmp->flags.focused) || wPreferences.auto_focus)
|
||||
if ((transientOwner && transientOwner->flags.focused)
|
||||
|| wPreferences.auto_focus)
|
||||
wSetFocusTo(scr, wwin);
|
||||
} else {
|
||||
wwin->flags.ignore_next_unmap = 1;
|
||||
@@ -1016,7 +1065,7 @@ wManageWindow(WScreen *scr, Window window)
|
||||
* Prevent window withdrawal when getting the
|
||||
* unmap notifies generated during reparenting
|
||||
*/
|
||||
wwin->flags.mapped=0;
|
||||
wwin->flags.mapped = 0;
|
||||
|
||||
XSync(dpy, 0);
|
||||
|
||||
@@ -1024,6 +1073,16 @@ wManageWindow(WScreen *scr, Window window)
|
||||
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
|
||||
|
||||
#ifdef OLWM_HINTS
|
||||
if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL
|
||||
&& !WFLAGP(wwin, no_close_button)) {
|
||||
|
||||
XWarpPointer(dpy, None, None, 0, 0, 0, 0,
|
||||
wwin->frame_x + width - wwin->frame->titlebar->height * 2,
|
||||
wwin->frame_y);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*--------------------------------------------------
|
||||
* Cleanup temporary stuff
|
||||
@@ -1125,7 +1184,11 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
||||
XMapSubwindows(dpy, wwin->frame->core->window);
|
||||
|
||||
/* setup stacking descriptor */
|
||||
if (wPreferences.on_top_transients && wwin->transient_for!=None
|
||||
if (
|
||||
#ifdef removed
|
||||
wPreferences.on_top_transients &&
|
||||
#endif
|
||||
wwin->transient_for!=None
|
||||
&& wwin->transient_for!=scr->root_win) {
|
||||
WWindow *tmp;
|
||||
tmp = wWindowFor(wwin->transient_for);
|
||||
@@ -1182,12 +1245,12 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
wUnmanageWindow(WWindow *wwin, int restore)
|
||||
wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
||||
{
|
||||
WCoreWindow *frame = wwin->frame->core;
|
||||
WWindow *owner;
|
||||
WWindow *newFocusedWindow;
|
||||
int wasNotFocused;
|
||||
WWindow *owner = NULL;
|
||||
WWindow *newFocusedWindow = NULL;
|
||||
int wasFocused;
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
|
||||
|
||||
@@ -1207,9 +1270,13 @@ wUnmanageWindow(WWindow *wwin, int restore)
|
||||
if (wwin->flags.menu_open_for_me) {
|
||||
CloseWindowMenu(scr);
|
||||
}
|
||||
if (!wwin->flags.internal_window)
|
||||
XRemoveFromSaveSet(dpy, wwin->client_win);
|
||||
XSelectInput(dpy, wwin->client_win, NoEventMask);
|
||||
|
||||
if (!destroyed) {
|
||||
if (!wwin->flags.internal_window)
|
||||
XRemoveFromSaveSet(dpy, wwin->client_win);
|
||||
|
||||
XSelectInput(dpy, wwin->client_win, NoEventMask);
|
||||
}
|
||||
|
||||
XUnmapWindow(dpy, frame->window);
|
||||
|
||||
@@ -1232,12 +1299,15 @@ wUnmanageWindow(WWindow *wwin, int restore)
|
||||
if (wwin->transient_for!=scr->root_win) {
|
||||
owner = wWindowFor(wwin->transient_for);
|
||||
if (owner) {
|
||||
owner->flags.semi_focused = 0;
|
||||
wFrameWindowChangeState(owner->frame, WS_UNFOCUSED);
|
||||
if (!owner->flags.semi_focused) {
|
||||
owner = NULL;
|
||||
} else {
|
||||
owner->flags.semi_focused = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wasNotFocused = !wwin->flags.focused;
|
||||
wasFocused = wwin->flags.focused;
|
||||
|
||||
/* remove from window focus list */
|
||||
if (!wwin->prev && !wwin->next) {
|
||||
@@ -1313,8 +1383,13 @@ wUnmanageWindow(WWindow *wwin, int restore)
|
||||
printf("destroying window %x frame %x\n", (unsigned)wwin->client_win,
|
||||
(unsigned)frame->window);
|
||||
#endif
|
||||
if (!wasNotFocused)
|
||||
|
||||
if (wasFocused) {
|
||||
if (newFocusedWindow != owner && owner) {
|
||||
wFrameWindowChangeState(owner->frame, WS_UNFOCUSED);
|
||||
}
|
||||
wSetFocusTo(scr, newFocusedWindow);
|
||||
}
|
||||
wWindowDestroy(wwin);
|
||||
XFlush(dpy);
|
||||
}
|
||||
@@ -1346,10 +1421,30 @@ void
|
||||
wWindowMap(WWindow *wwin)
|
||||
{
|
||||
XMapWindow(dpy, wwin->frame->core->window);
|
||||
wwin->flags.mapped = 1;
|
||||
if (!wwin->flags.shaded) {
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
wwin->flags.mapped = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wWindowUnmap(WWindow *wwin)
|
||||
{
|
||||
XWindowAttributes attribs;
|
||||
|
||||
XGetWindowAttributes(dpy, wwin->client_win, &attribs);
|
||||
wwin->flags.mapped = 0;
|
||||
|
||||
/* prevent window withdrawal when getting UnmapNotify */
|
||||
XSelectInput(dpy, wwin->client_win,
|
||||
attribs.your_event_mask & ~StructureNotifyMask);
|
||||
XUnmapWindow(dpy, wwin->client_win);
|
||||
XSelectInput(dpy, wwin->client_win, attribs.your_event_mask);
|
||||
|
||||
XUnmapWindow(dpy, wwin->frame->core->window);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wWindowUnfocus(WWindow *wwin)
|
||||
@@ -1504,7 +1599,6 @@ wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
||||
wapp->last_workspace = workspace;
|
||||
}
|
||||
unmap = 1;
|
||||
wwin->flags.mapped = 0;
|
||||
wSetFocusTo(scr, NULL);
|
||||
}
|
||||
} else {
|
||||
@@ -1525,8 +1619,9 @@ wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
||||
wKWMUpdateClientWorkspace(wwin);
|
||||
wKWMSendEventMessage(wwin, WKWMChangedClient);
|
||||
#endif
|
||||
if (unmap)
|
||||
XUnmapWindow(dpy, wwin->frame->core->window);
|
||||
if (unmap) {
|
||||
wWindowUnmap(wwin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2492,12 +2587,29 @@ windowCloseClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||
|
||||
CloseWindowMenu(wwin->screen_ptr);
|
||||
|
||||
if (event->xbutton.button < Button1 || event->xbutton.button > Button3)
|
||||
return;
|
||||
|
||||
/* if control-click, kill the client */
|
||||
if (event->xbutton.state & ControlMask) {
|
||||
wClientKill(wwin);
|
||||
} else if (wwin->protocols.DELETE_WINDOW && event->xbutton.state==0) {
|
||||
/* send delete message */
|
||||
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);
|
||||
} else {
|
||||
#ifdef OLWM_HINTS
|
||||
if (wwin->flags.olwm_push_pin_out) {
|
||||
|
||||
wwin->flags.olwm_push_pin_out = 0;
|
||||
|
||||
wOLWMChangePushpinState(wwin, True);
|
||||
|
||||
wFrameWindowUpdatePushButton(wwin->frame, False);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (wwin->protocols.DELETE_WINDOW && event->xbutton.state==0) {
|
||||
/* send delete message */
|
||||
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2509,6 +2621,9 @@ windowCloseDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||
|
||||
CloseWindowMenu(wwin->screen_ptr);
|
||||
|
||||
if (event->xbutton.button < Button1 || event->xbutton.button > Button3)
|
||||
return;
|
||||
|
||||
/* send delete message */
|
||||
if (wwin->protocols.DELETE_WINDOW) {
|
||||
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);
|
||||
@@ -2526,7 +2641,10 @@ windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||
event->xbutton.state &= ValidModMask;
|
||||
|
||||
CloseWindowMenu(wwin->screen_ptr);
|
||||
|
||||
|
||||
if (event->xbutton.button < Button1 || event->xbutton.button > Button3)
|
||||
return;
|
||||
|
||||
if (wwin->protocols.MINIATURIZE_WINDOW && event->xbutton.state==0) {
|
||||
wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW,
|
||||
LastTimestamp);
|
||||
|
||||
+20
-6
@@ -101,7 +101,7 @@ typedef struct {
|
||||
|
||||
/* ours */
|
||||
unsigned int kill_close:1; /* can't send WM_DELETE_WINDOW */
|
||||
|
||||
|
||||
unsigned int no_shadeable:1;
|
||||
unsigned int omnipresent:1;
|
||||
unsigned int skip_window_list:1;
|
||||
@@ -132,6 +132,14 @@ typedef struct {
|
||||
* generate their own appicons and for apps that have no_appicon=1
|
||||
*/
|
||||
unsigned int emulate_appicon:1;
|
||||
|
||||
/* toolkit specific attribute flags. These are unchangeable and
|
||||
* unconfigurable and must not be saved as state. */
|
||||
#ifdef OLWM_HINTS
|
||||
unsigned int olwm_transient:1;
|
||||
unsigned int olwm_warp_to_pin:1;
|
||||
#endif
|
||||
|
||||
} WWindowAttributes;
|
||||
|
||||
|
||||
@@ -141,9 +149,8 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int TAKE_FOCUS:1;
|
||||
unsigned int SAVE_YOURSELF:1;
|
||||
unsigned int DELETE_WINDOW:1;
|
||||
|
||||
unsigned int SAVE_YOURSELF:1;
|
||||
/* WindowMaker specific */
|
||||
unsigned int MINIATURIZE_WINDOW:1;
|
||||
#ifdef MONITOR_HEARTBEAT
|
||||
@@ -212,7 +219,11 @@ typedef struct WWindow {
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
int languagemode;
|
||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||
|
||||
|
||||
#ifdef OLWM_HINTS_unfinished
|
||||
struct WOLWindowState ol_window_state;
|
||||
#endif
|
||||
|
||||
#ifdef MONITOR_HEARTBEAT
|
||||
time_t last_beat;
|
||||
#endif
|
||||
@@ -253,11 +264,12 @@ typedef struct WWindow {
|
||||
|
||||
unsigned int menu_open_for_me:1; /* window commands menu */
|
||||
|
||||
unsigned int waiting_save_ack:1; /* waiting for SAVE_YOURSELF ack */
|
||||
#ifdef KWM_HINTS
|
||||
unsigned int kwm_hidden_for_modules:1;
|
||||
#endif
|
||||
#ifdef OLWM_HINTS
|
||||
unsigned int olwm_push_pin:1; /* emulate pushpin behaviour */
|
||||
unsigned int olwm_push_pin_out:1;/* emulate pushpin behaviour */
|
||||
unsigned int olwm_limit_menu:1;
|
||||
#endif
|
||||
} flags; /* state of the window */
|
||||
@@ -314,7 +326,7 @@ void wWindowClearShape(WWindow *wwin);
|
||||
|
||||
WWindow *wManageWindow(WScreen *scr, Window window);
|
||||
|
||||
void wUnmanageWindow(WWindow *wwin, int restore);
|
||||
void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed);
|
||||
|
||||
void wWindowFocus(WWindow *wwin);
|
||||
void wWindowUnfocus(WWindow *wwin);
|
||||
@@ -351,6 +363,8 @@ void wWindowUpdateGNUstepAttr(WWindow *wwin, GNUstepWMAttributes *attr);
|
||||
|
||||
void wWindowMap(WWindow *wwin);
|
||||
|
||||
void wWindowUnmap(WWindow *wwin);
|
||||
|
||||
Bool wWindowCanReceiveFocus(WWindow *wwin);
|
||||
|
||||
void wWindowDeleteSavedStatesForPID(pid_t pid);
|
||||
|
||||
+8
-8
@@ -169,10 +169,8 @@ destroyInspector(WCoreWindow *foo, void *data, XEvent *event)
|
||||
|
||||
WMRemoveNotificationObserver(panel);
|
||||
|
||||
XUnmapWindow(dpy, panel->parent);
|
||||
XReparentWindow(dpy, panel->parent, panel->frame->screen_ptr->root_win,
|
||||
0, 0);
|
||||
wUnmanageWindow(panel->frame, False);
|
||||
panel->frame->flags.mapped = 0;
|
||||
wUnmanageWindow(panel->frame, True, False);
|
||||
|
||||
freeInspector(panel);
|
||||
}
|
||||
@@ -187,8 +185,8 @@ wDestroyInspectorPanels()
|
||||
while (panelList != NULL) {
|
||||
panel = panelList;
|
||||
panelList = panelList->nextPtr;
|
||||
wUnmanageWindow(panel->frame, False, False);
|
||||
WMDestroyWidget(panel->win);
|
||||
wUnmanageWindow(panel->frame, False);
|
||||
|
||||
panel->inspected->flags.inspector_open = 0;
|
||||
panel->inspected->inspector = NULL;
|
||||
@@ -744,7 +742,7 @@ applySettings(WMButton *button, InspectorPanel *panel)
|
||||
}
|
||||
|
||||
if (WFLAGP(wwin, no_bind_keys) != old_no_bind_keys) {
|
||||
if (!WFLAGP(wwin, no_bind_keys)) {
|
||||
if (WFLAGP(wwin, no_bind_keys)) {
|
||||
XUngrabKey(dpy, AnyKey, AnyModifier, wwin->frame->core->window);
|
||||
} else {
|
||||
wWindowSetKeyGrabs(wwin);
|
||||
@@ -923,7 +921,9 @@ chooseIconCallback(WMWidget *self, void *clientData)
|
||||
|
||||
WMSetButtonEnabled(panel->browseIconBtn, False);
|
||||
|
||||
result = wIconChooserDialog(panel->frame->screen_ptr, &file);
|
||||
result = wIconChooserDialog(panel->frame->screen_ptr, &file,
|
||||
panel->inspected->wm_instance,
|
||||
panel->inspected->wm_class);
|
||||
|
||||
panel->choosingIcon = 0;
|
||||
|
||||
@@ -946,7 +946,7 @@ textEditedObserver(void *observerData, WMNotification *notification)
|
||||
{
|
||||
InspectorPanel *panel = (InspectorPanel*)observerData;
|
||||
|
||||
if ((int)WMGetNotificationClientData(notification) != WMReturnTextMovement)
|
||||
if ((long)WMGetNotificationClientData(notification) != WMReturnTextMovement)
|
||||
return;
|
||||
|
||||
if (observerData == panel->fileText) {
|
||||
|
||||
+22
-13
@@ -128,7 +128,9 @@ wWorkspaceNew(WScreen *scr)
|
||||
wKWMUpdateWorkspaceCountHint(scr);
|
||||
wKWMUpdateWorkspaceNameHint(scr, scr->workspace_count-1);
|
||||
}
|
||||
#ifdef not_used
|
||||
wKWMSetUsableAreaHint(scr, scr->workspace_count-1);
|
||||
#endif
|
||||
#endif
|
||||
XFlush(dpy);
|
||||
|
||||
@@ -261,7 +263,7 @@ wWorkspaceRelativeChange(WScreen *scr, int amount)
|
||||
void
|
||||
wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
{
|
||||
WWindow *tmp, *foc=NULL;
|
||||
WWindow *tmp, *foc=NULL, *foc2=NULL;
|
||||
|
||||
if (workspace >= MAX_WORKSPACES || workspace < 0)
|
||||
return;
|
||||
@@ -280,15 +282,18 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
|
||||
wWorkspaceMenuUpdate(scr, scr->clip_ws_menu);
|
||||
|
||||
if ((tmp = scr->focused_window)!= NULL) {
|
||||
if ((tmp = scr->focused_window)!= NULL) {
|
||||
if (IS_OMNIPRESENT(tmp))
|
||||
foc = tmp;
|
||||
|
||||
while (tmp) {
|
||||
if (tmp->frame->workspace!=workspace && !tmp->flags.selected) {
|
||||
/* unmap windows not on this workspace */
|
||||
if ((tmp->flags.mapped||tmp->flags.shaded)
|
||||
&& !IS_OMNIPRESENT(tmp)
|
||||
&& !tmp->flags.changing_workspace) {
|
||||
XUnmapWindow(dpy, tmp->frame->core->window);
|
||||
tmp->flags.mapped = 0;
|
||||
|
||||
wWindowUnmap(tmp);
|
||||
}
|
||||
/* also unmap miniwindows not on this workspace */
|
||||
if (tmp->flags.miniaturized && !IS_OMNIPRESENT(tmp)
|
||||
@@ -311,23 +316,23 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
if (wapp) {
|
||||
wapp->last_workspace = workspace;
|
||||
}
|
||||
if (!foc2)
|
||||
foc2 = tmp;
|
||||
}
|
||||
} else {
|
||||
/* change selected windows' workspace */
|
||||
if (tmp->flags.selected) {
|
||||
wWindowChangeWorkspace(tmp, workspace);
|
||||
if (!tmp->flags.miniaturized) {
|
||||
if (!tmp->flags.miniaturized && !foc) {
|
||||
foc = tmp;
|
||||
}
|
||||
} else {
|
||||
if (!tmp->flags.hidden) {
|
||||
if (!(tmp->flags.mapped || tmp->flags.miniaturized)) {
|
||||
/* remap windows that are on this workspace */
|
||||
XMapWindow(dpy, tmp->frame->core->window);
|
||||
wWindowMap(tmp);
|
||||
if (!foc)
|
||||
foc = tmp;
|
||||
if (!tmp->flags.shaded)
|
||||
tmp->flags.mapped = 1;
|
||||
}
|
||||
/* Also map miniwindow if not omnipresent */
|
||||
if (!wPreferences.sticky_icons &&
|
||||
@@ -342,7 +347,10 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
|
||||
if (scr->focused_window->flags.mapped) {
|
||||
if (!foc)
|
||||
foc = foc2;
|
||||
|
||||
if (scr->focused_window->flags.mapped && !foc) {
|
||||
foc = scr->focused_window;
|
||||
}
|
||||
if (wPreferences.focus_mode == WKF_CLICK) {
|
||||
@@ -393,14 +401,14 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
#ifdef KWM_HINTS
|
||||
wKWMUpdateCurrentWorkspaceHint(scr);
|
||||
#endif
|
||||
XFlush(dpy);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
wWorkspaceChange(menu->frame->screen_ptr, (int)entry->clientdata);
|
||||
wWorkspaceChange(menu->frame->screen_ptr, (long)entry->clientdata);
|
||||
}
|
||||
|
||||
|
||||
@@ -517,7 +525,7 @@ onMenuEntryEdited(WMenu *menu, WMenuEntry *entry)
|
||||
char *tmp;
|
||||
|
||||
tmp = entry->text;
|
||||
wWorkspaceRename(menu->frame->screen_ptr, (int)entry->clientdata, tmp);
|
||||
wWorkspaceRename(menu->frame->screen_ptr, (long)entry->clientdata, tmp);
|
||||
}
|
||||
|
||||
|
||||
@@ -546,7 +554,8 @@ wWorkspaceMenuMake(WScreen *scr, Bool titled)
|
||||
void
|
||||
wWorkspaceMenuUpdate(WScreen *scr, WMenu *menu)
|
||||
{
|
||||
int i, ws;
|
||||
int i;
|
||||
long ws;
|
||||
char title[MAX_WORKSPACENAME_WIDTH+1];
|
||||
WMenuEntry *entry;
|
||||
int tmp;
|
||||
|
||||
Reference in New Issue
Block a user