as the title says, when I run my application on Windows a modal window will not have an exit button in the right-hand corner. The linux version does. Is this a bug or do I have to do something different on Windows.
as the title says, when I run my application on Windows a modal window will not have an exit button in the right-hand corner. The linux version does. Is this a bug or do I have to do something different on Windows.
P.S. The text files in the windows version do not have Carraige Characters (0x0d). Should they ??
On 10/18/22 02:13, Ian MacArthur wrote:
P.S. The text files in the windows version do not have Carraige Characters (0x0d). Should they ??
Do not think I understood this question.Can you clarify...
[..re: crlf on windows vs unix..]
I use jedit and yes it handles them but I have found errors on Windows where
it is not handled so well (MASM for instance).
to the original query, I not so sure opening a window that cannot
be closed IS the correct behaviour.
And no, the windows I m seeing that are modal are not borderless.as for what I trying to do, I am trying to incorporate a cross platform GUI toolkit that works the same way on Windows as it does on Linux. (don't care about MacOS)
On 10/18/22 14:32, roger tunnicliffe wrote:
as for the screenshot, here 'tis
On 10/18/22 16:45, roger tunnicliffe wrote:
On Wednesday, October 19, 2022 at 8:52:43 AM UTC+11 er...@seriss.com wrote:
On 10/18/22 14:32, roger tunnicliffe wrote:
as for the screenshot, here 'tis
Huh, yeah, I think those missing buttons are called "window decorations",
and are provided by the window manager, but controllable I think by FLTK
as flags for the window.
The difference you'll find is that if the window is Modal they do not appear as
opposed to NOT modal, where they do appear
So devs: is this a bug needing to be reported?diff --git a/test/hello.cxx b/test/hello.cxx
index d7308cd78..84fb82df3 100644
--- a/test/hello.cxx
+++ b/test/hello.cxx
@@ -20,6 +20,7 @@
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(340, 180);
+ window->set_modal();
Fl_Box *box = new Fl_Box(20, 40, 300, 100, "Hello, World!");
box->box(FL_UP_BOX);
box->labelfont(FL_BOLD + FL_ITALIC);
So devs: is this a bug needing to be reported?
Seems to be, as the same code has no "X" on Windows but does on Linux/Xwindows:
I had a quick look back at a Excel VBA system I wrote some time back (I really like VBA) and the Windows are Modal yet still have the decorations.
Cheers
>The window decorations are provided by the WM, not be fltk, so the differences you are seeing are WM differences, not fltk ones. On MS-Windows, >modal windows tend not to have decorations, non-modal windows do (but sometimes "smaller then usual", depending on WInXX version) and >normal windows have the normal decorations.This isn't quite right.FLTK has made the choice to disable those decorations on Windows for modal(). The system menu and close buttons are allowed to be there for a modal window under Windows. This code in Fl_Win32.cxx is responsible (bolding mine):// Thin border and title bar
case 1:
style |= WS_DLGFRAME | WS_CAPTION;
if (!w->modal())
style |= WS_SYSMENU | WS_MINIMIZEBOX;
break;I.e if modal, don't provide the menu/close and minimize buttons.
Looking at the code for X11, I don't see any similar attempt to turn OFF the buttons for a modal window. Given the headache I got tryingto read the X11 details, I'm thinking it's just HARD to do so for X11.
On the subject though, I do have a concern with this chunk of code in the X11 driver: (FLTK 1.4 : Fl_x.cxx, line 2516)if (win->non_modal() && xp->next && !fl_disable_transient_for) {
// find some other window to be "transient for":
Fl_Window* wp = xp->next->w;
while (wp->parent()) wp = wp->window();
XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
if (!wp->visible()) showit = 0; // guess that wm will not show it
if (win->modal()) {
Atom net_wm_state = XInternAtom (fl_display, "_NET_WM_STATE", 0);
Atom net_wm_state_skip_taskbar = XInternAtom (fl_display, "_NET_WM_STATE_MODAL", 0);
XChangeProperty (fl_display, xp->xid, net_wm_state, XA_ATOM, 32,
PropModeAppend, (unsigned char*) &net_wm_state_skip_taskbar, 1);
}
}Again, bolding mine. Unless I've misread this, it appears for the modal() case, FLTK will never set _NET_WM_STATE_MODAL. Note this code is the same under FLTK 1.3.5 and FLTK 1.4. [Here's the commit from 2014]