add apps key to ignore XSizeHints BUG: 1075
Thomas Lübking thomas.luebking@gmail.com
4 files changed,
21 insertions(+),
1 deletions(-)
M
doc/asciidoc/fluxbox-apps.txt
→
doc/asciidoc/fluxbox-apps.txt
@@ -128,6 +128,13 @@ Opens the application with the specified 'width' and 'height', in pixels.
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
M
src/Remember.cc
→
src/Remember.cc
@@ -166,6 +166,8 @@ int w,h; // width, height
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 @@ h = FbTk::StringUtil::parseSizeToken(tokens[1], h_relative, ignore);
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 @@ break;
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;@@ -1264,6 +1271,9 @@ app->forgetHead();
break; case REM_DIMENSIONS: app->forgetDimensions(); + break; + case REM_IGNORE_SIZEHINTS: + app->ignoreSizeHints_remember = false; break; case REM_POSITION: app->forgetPosition();
M
src/Remember.hh
→
src/Remember.hh
@@ -75,6 +75,7 @@ REM_MINIMIZEDSTATE,
REM_MAXIMIZEDSTATE, REM_FULLSCREENSTATE, REM_FOCUSPROTECTION, + REM_IGNORE_SIZEHINTS, REM_LASTATTRIB // not actually used };
M
src/WinClient.cc
→
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::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;