add apps key to ignore XSizeHints

BUG: 1075
This commit is contained in:
Thomas Lübking 2016-08-12 08:33:39 +02:00 committed by Mathias Gumz
parent 3df681da2d
commit 8d88d9be17
4 changed files with 21 additions and 1 deletions

View file

@ -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

View file

@ -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;

View file

@ -75,6 +75,7 @@ public:
REM_MAXIMIZEDSTATE,
REM_FULLSCREENSTATE,
REM_FOCUSPROTECTION,
REM_IGNORE_SIZEHINTS,
REM_LASTATTRIB // not actually used
};

View file

@ -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;