determing WM titlebar size; problems with Fl_Window::decorated_w() and Fl_Window::decorated_h()?

15 skatījumi
Pāriet uz pirmo nelasīto ziņojumu

Paul Hahn

nelasīta,
2020. gada 9. sept. 00:50:3409.09.20
uz fltk.general
I am using FLTK 1.4 bleeding edge on Linux (CentOS 6 latest kernel) on a Dell 64 bit Xeon-based workstation.

According to the 1.4 documentation, the subject methods return the dimension of the window including the window manager title bar. But I find that the results from these methods are identical to results from w() and h(). I mean, when the window in question is top-level (an Fl_Double_Window), not a sub-window.

Goal: I am trying to figure out max available drawable surface on a screen for sizing my application main window, as well as dialog windows. Yes, I also employ Fl::screen_work_area() and Fl::screen_xywh().

Attached is a trivial demo program that reports decorated_w() equals w() and and decorated_h() equals h(), at least in my environment .

Am I not understanding something?

TIA!

decor.cxx

Manolo

nelasīta,
2020. gada 9. sept. 05:20:3409.09.20
uz fltk.general
Ian has already explained that Fl_Window::decorated_w/h() are effective only when the window
has been mapped. These 2 calls:
       mywindow->show();    mywindow->wait_for_expose();
make sure the window is mapped.

Furthermore, when FLTK creates a window, it makes sure it's not bigger than the screen and resizes it if it's bigger.
(It's possible to resize a window bigger later on).

Paul Hahn

nelasīta,
2020. gada 9. sept. 09:16:0109.09.20
uz fltk.general
Upon explanation it makes total sense now. Thank you Ian and Manolo!

Sometimes using FLTK gets too easy it seems, so what is sensible yet a bit nuanced (e.g., for me) may be too easily overlooked.  I humbly suggest addition of a line or two in the FLTK doco for the decorated_w() / decorated_h() methods in regards to the issue, if time permits. Love FLTK!
Atbildēt visiem
Atbildēt autoram
Pārsūtīt
0 jauni ziņojumi