|
|
commit 02754e43ceb2d1d7a20b706c90d5aa9b2f6a95ad
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed Nov 17 14:58:45 2021 +0100
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed Nov 17 15:00:21 2021 +0100
Fix Fl_Window::decorated_w() in some X11 situations.
src/drivers/X11/Fl_X11_Window_Driver.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git src/drivers/X11/Fl_X11_Window_Driver.cxx src/drivers/X11/Fl_X11_Window_Driver.cxx
index ab15f27..5dea0fb 100644
--- src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -159,6 +159,15 @@ void Fl_X11_Window_Driver::decorated_win_size(int &w, int &h)
if (status == 0 || root == parent) return;
XWindowAttributes attributes;
XGetWindowAttributes(fl_display, parent, &attributes);
+ // sometimes, very wide window borders are reported
+ // ignore them all:
+ XWindowAttributes w_attributes;
+ XGetWindowAttributes(fl_display, Fl_X::i(win)->xid, &w_attributes);
+ if (attributes.width - w_attributes.width >= 20) {
+ attributes.height -= (attributes.width - w_attributes.width);
+ attributes.width = w_attributes.width;
+ }
+
int nscreen = screen_num();
float s = Fl::screen_driver()->scale(nscreen);
w = attributes.width / s;
[ Direct Link to Message ] | |
|
| |