RE: [fltk.general] Weird FL_Window behavior when FLTK 1.3.x is compiled with Microsoft Visual C++ 2013

22 views
Skip to first unread message

MacArthur, Ian (Selex ES, UK)

unread,
Apr 28, 2015, 11:37:32 AM4/28/15
to fltkg...@googlegroups.com
> We came upon a very strange behavior that looks likely like a bug. When
> FLTK 1.3.X (tested on 1.3.1, 1.3.2, 1.3.3) is compiled using MSVC 2013,
> Fl_Window shrinks when it's hidden then shown successively.


> Run the test, and the window should be very small. The strange thing is
> that this works when compiled using MSVC 2010 (this also works on OS X
> and Linux). I've tried to pinpoint the issue without any luck so far. In
> the file Fl_win32.cxx in Fl_Window::show size is altered after the
> Fl_X::make(this) call.

> Any idea on what could cause the issue? I thought about a static
> initialization fiasco highlighted by the new compiler but it doesn't
> seem to be related to that.

No, it's not that; MS changed the way that window borders are dimensioned, but only *if* the PE executable type has MajorSubsystemVersion = 6 in the optional header of the image, and that messes up all manner of calculations about window sizes and placement. Depending on how your tools are set up, your more recent VS compiler is probably setting the MajorSubsystemVersion, whereas the older VS toolchain probably does not set it (or sets it to 5.)

STR #3061 refers. http://www.fltk.org/str.php?L3061

There were a few related STR's too, but I can't recall their numbers now...

Anyway, this ought to be fixed in recent snapshots, or you can just edit the MajorSubsystemVersion to 5 or less and all will be well.

Try pulling one of the recent weeklies and building clean with that, see if the problem is resolved or not.



Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Sam

unread,
Apr 28, 2015, 11:57:26 AM4/28/15
to fltkg...@googlegroups.com, ian.ma...@selex-es.com
Fantastic! Thanks for your help, this was really puzzling!

Ian MacArthur

unread,
Apr 28, 2015, 4:26:43 PM4/28/15
to fltkg...@googlegroups.com
On Tue Apr 28 2015 16:57:26, Sam wrote:
> Fantastic! Thanks for your help, this was really puzzling!

Your welcome. But...

Let's wait until we are sure the latest builds actually do solve the issue!




Reply all
Reply to author
Forward
0 new messages