From 8d88d9be176f255bb85b13a9719145127273467c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 12 Aug 2016 08:33:39 +0200 Subject: [PATCH] add apps key to ignore XSizeHints BUG: 1075 --- doc/asciidoc/fluxbox-apps.txt | 7 +++++++ src/Remember.cc | 10 ++++++++++ src/Remember.hh | 1 + src/WinClient.cc | 4 +++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/asciidoc/fluxbox-apps.txt b/doc/asciidoc/fluxbox-apps.txt index 79c3710a..428d0e28 100644 --- a/doc/asciidoc/fluxbox-apps.txt +++ b/doc/asciidoc/fluxbox-apps.txt @@ -128,6 +128,13 @@ respectively. If the value is given in percent, then the window size will be based on the current screen's size. +*[IgnoreSizeHints]* {'bool'}:: + Some Applications restrict the aspect ratio, minimum or maximum size of + windows. Setting this key "yes" will make fluxbox ignore those constraints. + *NOTICE* that bad client implementations may hard depend on these + constraints (by blindly using their geometry in unsave calculations, causing + div-by-zero segfaults etc.) + *[Position]* ('anchor') {'X[%]' 'Y[%]'}:: Position the application at a particular spot. By default the upper-left corner is placed at screen coordinates ('X','Y'). If you specify an 'anchor', say diff --git a/src/Remember.cc b/src/Remember.cc index 6545b504..49e61062 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -166,6 +166,8 @@ public: bool dimension_is_w_relative; bool dimension_is_h_relative; + bool ignoreSizeHints_remember; + bool position_remember; int x,y; bool position_is_x_relative; @@ -497,6 +499,8 @@ int parseApp(ifstream &file, Application &app, string *first_line = 0) { app.rememberDimensions(w, h, w_relative, h_relative); } else had_error = true; + } else if (str_key == "ignoresizehints") { + app.ignoreSizeHints_remember = str_label == "yes"; } else if (str_key == "position") { FluxboxWindow::ReferenceCorner r = FluxboxWindow::LEFTTOP; // more info about the parameter @@ -1119,6 +1123,9 @@ bool Remember::isRemembered(WinClient &winclient, Attribute attrib) { case REM_DIMENSIONS: return app->dimensions_remember; break; + case REM_IGNORE_SIZEHINTS: + return app->ignoreSizeHints_remember; + break; case REM_POSITION: return app->position_remember; break; @@ -1265,6 +1272,9 @@ void Remember::forgetAttrib(WinClient &winclient, Attribute attrib) { case REM_DIMENSIONS: app->forgetDimensions(); break; + case REM_IGNORE_SIZEHINTS: + app->ignoreSizeHints_remember = false; + break; case REM_POSITION: app->forgetPosition(); break; diff --git a/src/Remember.hh b/src/Remember.hh index fe331928..880fbe1f 100644 --- a/src/Remember.hh +++ b/src/Remember.hh @@ -75,6 +75,7 @@ public: REM_MAXIMIZEDSTATE, REM_FULLSCREENSTATE, REM_FOCUSPROTECTION, + REM_IGNORE_SIZEHINTS, REM_LASTATTRIB // not actually used }; diff --git a/src/WinClient.cc b/src/WinClient.cc index 22ee7661..022a4ca9 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -24,6 +24,7 @@ #include "Window.hh" #include "fluxbox.hh" #include "FocusControl.hh" +#include "Remember.hh" #include "Screen.hh" #include "FbAtoms.hh" #include "Xutil.hh" @@ -427,7 +428,8 @@ void WinClient::updateWMHints() { void WinClient::updateWMNormalHints() { long icccm_mask; XSizeHints sizehint; - if (!XGetWMNormalHints(display(), window(), &sizehint, &icccm_mask)) + if (Remember::instance().isRemembered(*this, Remember::REM_IGNORE_SIZEHINTS) || + !XGetWMNormalHints(display(), window(), &sizehint, &icccm_mask)) sizehint.flags = 0; normal_hint_flags = sizehint.flags;