1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Add a configuration option to ignore Decoration Hints from GTK-based application

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 <paul@jakma.org>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-05-10 19:56:08 +02:00
committed by Carlos R. Mafra
parent 5ecb96cbf4
commit ea42641033
7 changed files with 59 additions and 1 deletions

5
FAQ
View File

@@ -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 and click on the greyed "Disable titlebar" until it is white (the same can be
done for other decoration attributes). 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.
-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-

10
NEWS
View File

@@ -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. 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 --- 0.95.6
More image format supported More image format supported

View File

@@ -43,6 +43,9 @@ static const struct {
{ N_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."), { N_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."),
/* default: */ False, OPTION_WMAKER, "DisableMiniwindows" }, /* default: */ False, OPTION_WMAKER, "DisableMiniwindows" },
{ N_("Ignore decoration hints for GTK applications."),
/* default: */ False, OPTION_WMAKER, "IgnoreGtkHints" },
{ N_("Disable workspace pager."), { N_("Disable workspace pager."),
/* default: */ False, OPTION_WMAKER, "DisableWorkspacePager" }, /* default: */ False, OPTION_WMAKER, "DisableWorkspacePager" },

View File

@@ -394,6 +394,7 @@ extern struct WPreferences {
char dont_confirm_kill; /* do not confirm Kill application */ char dont_confirm_kill; /* do not confirm Kill application */
char disable_miniwindows; char disable_miniwindows;
char disable_workspace_pager; char disable_workspace_pager;
char ignore_gtk_decoration_hints;
char dont_blink; /* do not blink icon selection */ char dont_blink; /* do not blink icon selection */
@@ -558,6 +559,11 @@ extern struct wmaker_global_variables {
Atom titlebar_state; Atom titlebar_state;
} gnustep; } gnustep;
/* Destkop-environment related */
struct {
Atom gtk_object_path;
} desktop;
/* WindowMaker specific */ /* WindowMaker specific */
struct { struct {
Atom menu; Atom menu;

View File

@@ -518,6 +518,8 @@ WDefaultEntry optionList[] = {
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL}, &wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
{"MiniPreviewSize", "128", NULL, {"MiniPreviewSize", "128", NULL,
&wPreferences.minipreview_size, getInt, NULL, NULL, NULL}, &wPreferences.minipreview_size, getInt, NULL, NULL, NULL},
{"IgnoreGtkHints", "NO", NULL,
&wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL},
/* /*
* Backward Compatibility: * Backward Compatibility:

View File

@@ -394,6 +394,8 @@ static char *atomNames[] = {
GNUSTEP_WM_MINIATURIZE_WINDOW, GNUSTEP_WM_MINIATURIZE_WINDOW,
GNUSTEP_TITLEBAR_STATE, GNUSTEP_TITLEBAR_STATE,
"_GTK_APPLICATION_OBJECT_PATH",
"WM_IGNORE_FOCUS_EVENTS" "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.wm_miniaturize_window = atom[18];
w_global.atom.gnustep.titlebar_state = atom[19]; 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 #ifdef USE_DOCK_XDND
wXDNDInitializeAtoms(); wXDNDInitializeAtoms();

View File

@@ -288,6 +288,31 @@ static void setupGNUstepHints(WWindow *wwin, GNUstepWMAttributes *gs_hints)
wwin->client_flags.no_appicon = 1; 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) void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
{ {
WScreen *scr = wwin->screen_ptr; WScreen *scr = wwin->screen_ptr;
@@ -351,6 +376,9 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
wNETWMCheckClientHints(wwin, &tmp_level, &tmp_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 /* 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 * have INT_MIN that means that no window level was requested. -Dan
*/ */