diff --git a/src/wdefaults.c b/src/wdefaults.c index b57b0167..7aad3db5 100644 --- a/src/wdefaults.c +++ b/src/wdefaults.c @@ -82,6 +82,7 @@ static WMPropList *ASharedAppIcon; /* app */ static WMPropList *ANoLanguageButton; #endif static WMPropList *AStartWorkspace; +static WMPropList *AIgnoreDecorationChanges; static WMPropList *AIcon; static WMPropList *AnyWindow; static WMPropList *No; @@ -121,6 +122,7 @@ static void init_wdefaults(void) #endif AStartWorkspace = WMCreatePLString("StartWorkspace"); + AIgnoreDecorationChanges = WMCreatePLString("IgnoreDecorationChanges"); AnyWindow = WMCreatePLString("*"); No = WMCreatePLString("No"); @@ -301,6 +303,9 @@ void wDefaultFillAttributes(const char *instance, const char *class, value = get_value(dw, dc, dn, da, AFullMaximize, No, useGlobalDefault); APPLY_VAL(value, full_maximize, AFullMaximize); + value = get_value(dw, dc, dn, da, AIgnoreDecorationChanges, No, useGlobalDefault); + APPLY_VAL(value, ignore_decoration_changes, AIgnoreDecorationChanges); + #ifdef XKB_BUTTON_HINT value = get_value(dw, dc, dn, da, ANoLanguageButton, No, useGlobalDefault); APPLY_VAL(value, no_language_button, ANoLanguageButton); diff --git a/src/window.c b/src/window.c index d1e351ef..cb4ff4e7 100644 --- a/src/window.c +++ b/src/window.c @@ -412,6 +412,20 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) */ wDefaultFillAttributes(wwin->wm_instance, wwin->wm_class, &wwin->user_flags, &wwin->defined_user_flags, False); + + /* Restore decoration if the user has enabled the + * IgnoreDecorationChanges option */ + if (wwin->user_flags.ignore_decoration_changes) { + WSETUFLAG(wwin, no_titlebar, 0); + WSETUFLAG(wwin, no_resizable, 0); + WSETUFLAG(wwin, no_miniaturizable, 0); + WSETUFLAG(wwin, no_resizebar, 0); + WSETUFLAG(wwin, no_close_button, 0); + WSETUFLAG(wwin, no_miniaturize_button, 0); + WSETUFLAG(wwin, no_border, 0); + WSETUFLAG(wwin, no_movable, 0); + } + /* * Sanity checks for attributes that depend on other attributes */ diff --git a/src/window.h b/src/window.h index 1a4de2cb..6decb9b4 100644 --- a/src/window.h +++ b/src/window.h @@ -142,6 +142,8 @@ typedef struct { * generate their own appicons and for apps that have no_appicon=1 */ unsigned int emulate_appicon:1; + /* Ignore any changes to the decoration elements (titlebar, etc) */ + unsigned int ignore_decoration_changes:1; } WWindowAttributes; diff --git a/src/winspector.c b/src/winspector.c index e3d8f7f1..4f12e5ab 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -156,7 +156,11 @@ static const struct { { "NoMiniaturizable", { .no_miniaturizable = 1 }, N_("Do not let it be minimized"), N_("Do not let the window of this application be\n" - "minimized.\n") } + "minimized.\n") }, + + { "IgnoreDecorationChanges", { .ignore_decoration_changes = 1 }, N_("Ignore decoration changes"), + N_("Ignore any request from the application to change\n" + "window decorations (like hiding the titlebar).\n") } #ifdef XKB_BUTTON_HINT ,{ "NoLanguageButton", { .no_language_button = 1 }, N_("Disable language button"), diff --git a/src/wmspec.c b/src/wmspec.c index 0249c642..f6e74378 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -1325,6 +1325,17 @@ static Bool handleWindowType(WWindow *wwin, Atom type, int *layer) ret = False; } + /* Restore decoration if the user has enabled the + * IgnoreDecorationChanges option */ + if (WFLAGP(wwin, ignore_decoration_changes)) { + wwin->client_flags.no_titlebar = 0; + wwin->client_flags.no_resizable = 0; + wwin->client_flags.no_miniaturizable = 0; + wwin->client_flags.no_resizebar = 0; + wwin->client_flags.no_border = 0; + wwin->client_flags.no_movable = 0; + } + wwin->type = type; *layer = getWindowLayer(wwin);