As reported by Nerijus Baliunas and Paul Jakma, the GNOME application, which use the GTK toolkit, are asking to have no window decoration. This can be solved by editing the window's attributes in Window Maker, but this can be tedious when there are many GNOME application used.
This patch adds a configuration option: Window Maker tries to detect for GTK-based windows and in this case ignore the decoration hints that were provided by the application. Suggested-by: Paul Jakma <p...@jakma.org> Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> --- FAQ | 5 +++++ NEWS | 10 ++++++++++ WPrefs.app/Expert.c | 3 +++ src/WindowMaker.h | 6 ++++++ src/defaults.c | 2 ++ src/startup.c | 6 +++++- src/window.c | 28 ++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 1 deletion(-) diff --git a/FAQ b/FAQ index c458080..79ac476 100644 --- a/FAQ +++ b/FAQ @@ -740,6 +740,11 @@ The workaround is, for each application, to ask for Window Maker's window menu and click on the greyed "Disable titlebar" until it is white (the same can be done for other decoration attributes). +If you use a lot of GNOME applications, you may want to ask Window Maker to just +ignore the no-titlebar-and-all for all windows at once, which is done from +WPrefs by going to the "Expert" panel and checking the "Ignore decoration hints +for GTK applications" button. + -=-=-=-=-=-=-=- diff --git a/NEWS b/NEWS index 172c970..6561c4e 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,16 @@ Mini-Preview name. The setting is configurable with WPrefs in the Icon Preferences tab, the size is now expressed in pixels directly. +Ignore Decoration Hints from GNOME applications +----------------------------------------------- + +The GNOME applications ask Window Maker to get no title bar and no resize bar to +their windows by using "Hints". You can re-add them using the Attribute dialog +in the Window menu, but if you are using many GNOME applications you may want to +tell Window Maker to just ignore them. This is done with the new setting called +"IgnoreGtkHints", which is available in the "Expert" panel in WPrefs. + + --- 0.95.6 More image format supported diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 7268002..6db1dfa 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -43,6 +43,9 @@ static const struct { { N_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."), /* default: */ False, OPTION_WMAKER, "DisableMiniwindows" }, + { N_("Ignore decoration hints for GTK applications."), + /* default: */ False, OPTION_WMAKER, "IgnoreGtkHints" }, + { N_("Disable workspace pager."), /* default: */ False, OPTION_WMAKER, "DisableWorkspacePager" }, diff --git a/src/WindowMaker.h b/src/WindowMaker.h index ccdb6c8..3c2869c 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -394,6 +394,7 @@ extern struct WPreferences { char dont_confirm_kill; /* do not confirm Kill application */ char disable_miniwindows; char disable_workspace_pager; + char ignore_gtk_decoration_hints; char dont_blink; /* do not blink icon selection */ @@ -558,6 +559,11 @@ extern struct wmaker_global_variables { Atom titlebar_state; } gnustep; + /* Destkop-environment related */ + struct { + Atom gtk_object_path; + } desktop; + /* WindowMaker specific */ struct { Atom menu; diff --git a/src/defaults.c b/src/defaults.c index b6e855c..70fbeb5 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -518,6 +518,8 @@ WDefaultEntry optionList[] = { &wPreferences.panel_only_open, getBool, NULL, NULL, NULL}, {"MiniPreviewSize", "128", NULL, &wPreferences.minipreview_size, getInt, NULL, NULL, NULL}, + {"IgnoreGtkHints", "NO", NULL, + &wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL}, /* * Backward Compatibility: diff --git a/src/startup.c b/src/startup.c index 5f43cfd..8e633b8 100644 --- a/src/startup.c +++ b/src/startup.c @@ -394,6 +394,8 @@ static char *atomNames[] = { GNUSTEP_WM_MINIATURIZE_WINDOW, GNUSTEP_TITLEBAR_STATE, + "_GTK_APPLICATION_OBJECT_PATH", + "WM_IGNORE_FOCUS_EVENTS" }; @@ -467,7 +469,9 @@ void StartUp(Bool defaultScreenOnly) w_global.atom.gnustep.wm_miniaturize_window = atom[18]; w_global.atom.gnustep.titlebar_state = atom[19]; - w_global.atom.wm.ignore_focus_events = atom[20]; + w_global.atom.desktop.gtk_object_path = atom[20]; + + w_global.atom.wm.ignore_focus_events = atom[21]; #ifdef USE_DOCK_XDND wXDNDInitializeAtoms(); diff --git a/src/window.c b/src/window.c index b1cbd30..532670c 100644 --- a/src/window.c +++ b/src/window.c @@ -288,6 +288,31 @@ static void setupGNUstepHints(WWindow *wwin, GNUstepWMAttributes *gs_hints) wwin->client_flags.no_appicon = 1; } +static void discard_hints_from_gtk(WWindow *wwin) +{ + Atom type; + int format; + unsigned long nb_item, nb_remain; + unsigned char *result; + int status; + + status = XGetWindowProperty(dpy, wwin->client_win, w_global.atom.desktop.gtk_object_path, 0, 16, False, + AnyPropertyType, &type, &format, &nb_item, &nb_remain, &result); + if (status != Success) + return; + + /* If we're here, that means the Property exists. We don't care what is inside, it means it is a GTK-based application */ + + if (result != NULL) + XFree(result); + + /* GTK is asking to remove these decorations: */ + wwin->client_flags.no_titlebar = 0; + wwin->client_flags.no_close_button = 0; + wwin->client_flags.no_miniaturize_button = 0; + wwin->client_flags.no_resizebar = 0; +} + void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) { WScreen *scr = wwin->screen_ptr; @@ -351,6 +376,9 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) wNETWMCheckClientHints(wwin, &tmp_level, &tmp_workspace); + if (wPreferences.ignore_gtk_decoration_hints) + discard_hints_from_gtk(wwin); + /* window levels are between INT_MIN+1 and INT_MAX, so if we still * have INT_MIN that means that no window level was requested. -Dan */ -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.