diff --git a/FAQ b/FAQ index c4580800..79ac4765 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 172c970d..6561c4e4 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 72680023..6db1dfa1 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 ccdb6c8d..3c2869c6 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 b6e855c0..70fbeb59 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 5f43cfdc..8e633b86 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 b1cbd30f..532670ce 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 */