Commit Graph

266 Commits

Author SHA1 Message Date
Manolo Gouy
de37feb6b1 WIN32: fixed printing of window borders and title bar on Windows 10
by Fl_Paged_Device::print_window(). The GetWindowRect()
function gives inadequate results on Windows 10. DwmGetWindowAttributes()
from dwmapi.dll gives adequate results. This new function is dynamically
loaded at run-time, when dwmapi.dll is available.
On Windows XP, dwmapi.dll is not available.
On Windows 7, DwmGetWindowAttributes() returns with error, so GetWindowRect()
is used.
On Windows 10, DwmGetWindowAttributes() computes the correct window full rectangle.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10921 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-23 21:30:19 +00:00
Albrecht Schlosser
be81fa0f62 Fix potential Windows GDI leak (STR #3254).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10842 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-25 12:55:59 +00:00
Albrecht Schlosser
eb7d55e218 Document Fl_Window::show() calling Fl_Group::current(0).
Also fix indenting in src/Fl_win32.cxx.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10820 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-27 18:13:46 +00:00
Lauri Kasanen
03f69c0dd5 Add support for Fl::copy(..clipboard = 2..)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10731 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-05-18 09:10:06 +00:00
Manolo Gouy
f9fa74e3af Restored the possibility to call Fl::set_font()
in a global initializer (before main() starts).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-28 22:02:48 +00:00
Ian MacArthur
d0e5b00ea7 WIN32 specific fix for (or at least work around to) STR #3143.
In testing, this resolves the reported issue, but I'd be happy if we could find a
solution that resolved the underlying issue of us missing PostThreadMessage()
messages passed from the worker thread to the main thread, whilst the main window
is unresponsive (i.e. moving or dragging.)

This also puts in place an amendment to the way the awake callback ring-buffer indices
are tested, when the buffer is wrapping over or near to full. This was identified by 
Albrecht in STR #3223 (item #1 on that STR, though there are a few other issues 
identified there.)

In my testing, this appears to be correct and robust. Further testing would not go
amiss, however.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-23 10:11:23 +00:00
Manolo Gouy
dde47cbd6a Fix for STR#3167 where a window would decrease in size after each close/open (MSWindows-only).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-07 06:28:34 +00:00
Albrecht Schlosser
1b38bbdd2e Fix window icon when set before Fl_Window::show() - Windows only.
The window icon was reset during show() if it was set before show(),
because Fl_X::make() didn't check the new RGB image icons. Hence the
previously set Fl_RGB_Image icon was ignored and replaced by the default
Windows application icon.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10570 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-02-11 00:30:53 +00:00
Manolo Gouy
bd1446a6eb Fix for STR#3142 where fl_read_image() correctly reads GL data under X11, but ignores them under MSWindows and Mac OS X.
Moreover, fl_read_image() behaves differently with and without OS virtualization for X11 and MSWindows.
The patched function reads whatever is in the rectangle transmitted in arguments, with and without GL data, with and without subwindows,
on ‘true’ OS or on virtualized OS.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10436 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-06 16:48:57 +00:00
Pierre Ossman
8592cddcfd We need to put the newly created window in our window list
as quickly as possible or we might miss important window
messages.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10387 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-20 15:14:12 +00:00
Pierre Ossman
3e4af3cd8c Make sure we unregister for clipboard notifications on exit
on Windows. This is necessary because Windows doesn't implicitly
clean up when a process dies, and we cannot trust applications to
always explicitly unregister.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10367 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-09 12:52:05 +00:00
Pierre Ossman
933840f353 Start putting forward declarations early in the file in an
organised manner. Keeps things cleaner.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10366 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-09 11:52:43 +00:00
Pierre Ossman
6d06bb425d Make the retargeting of the Windows clipboard notification
more explicit. Otherwise we could end up with
Fl::remove_clipboard_notify() unregistering, just to have it
immediately re-register again.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10364 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-08 12:47:20 +00:00
Albrecht Schlosser
15de7c0600 Fix border padding for special cases (STR #3061), Windows only.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10363 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-08 11:57:43 +00:00
Pierre Ossman
1c7409e0a1 Add methods to enable and disable the system's input methods.
This needs to be done from FLTK as it affects the window interaction,
which FLTK is largely responsible for.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10314 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:44:35 +00:00
Pierre Ossman
61e1b18f7b Consolidate the Win32 init and cleanup code in to one place so
it's easier to keep track of it.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10312 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:35:05 +00:00
Pierre Ossman
53888cf064 Get rid of the old IActiveIMMApp code as the newer code calls
fatal() if it cannot be loaded and is hence already required.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10311 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:31:46 +00:00
Pierre Ossman
e145df2165 Add methods to intercept low level system events.
This gives applications the means to handle some low level
integration with the system that might otherwise not be possible
without modifying FLTK itself.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10310 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:17:56 +00:00
Pierre Ossman
321fb4ed7a Clean up Win32 message pump. The logic was a bit overly complex
with the double calls to PeekMessage() and the extra if clause.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10309 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:14:07 +00:00
Pierre Ossman
f58b1a91b3 Add ability to set custom icons for windows. STR #2816.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10197 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-16 11:39:32 +00:00
Pierre Ossman
332dc1b7ac Add method to set any custom cursor, based on a Fl_RGB_Image object.
Also change our fallback cursors to use this method, so that fallback
cursors are handled in a platform independent manner. STR #2660.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-16 11:17:57 +00:00
Pierre Ossman
7057e56c28 Behave better when it comes to modal windows. Primarily this
makes sure that windows are decorated better when a modal window
is active. STR #2802.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10190 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-11 14:09:28 +00:00
Pierre Ossman
0cfc2554c6 Support for full screen over multiple monitors.
The API follows that of EWMH, which gives you a good control
over which monitors to use.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-11 09:10:53 +00:00
Pierre Ossman
f27bde8316 Windows' clipboard chain is a very fragile thing that can
easily break if an application misbehaves and/or crashes.
So to minimise risk, don't register ourselves unless we
really need to.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10188 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-10 14:23:46 +00:00
Pierre Ossman
6944612e56 We are required to pass along WM_CHANGECBCHAIN messages to the
next window in order for the chain to properly update.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10187 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-10 14:21:26 +00:00
Manolo Gouy
07dd8ba328 Added copy/paste from/to FLTK applications of graphical data.
Added Fl_Image_Surface class to draw into an Fl_Image object.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10159 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-05-23 16:47:21 +00:00
Pierre Ossman
74aeae38cb Revert the revert in r10060, reinstating commit r10030.
The reason the code was problematic was because of r4589, where
a call to PostQuitMessage() snuck in. As we could not find a
valid reason for that PostQuitMessage(), it has been removed and
FLTK is now again properly responsive to WM_QUIT messages.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10094 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-02-05 09:38:22 +00:00
Manolo Gouy
fe1793f13b Stepping back from r.10030: when you close any window it stops the program!
Try with test/editor, opening several windows, and closing one.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10060 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-15 14:02:57 +00:00
Pierre Ossman
f7e88141c3 Catch WM_QUIT and convert it to SIGTERM. This gives Windows
applications a convenient way to request termination, rather
than forcing it. And it does so in a way that mimics UNIX's
way, allowing code reuse.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10030 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-12-13 10:26:03 +00:00
Pierre Ossman
1d6cc80d59 STR 2636. Add ability to get notifications whenever the
clipboard changes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-09-11 12:54:40 +00:00
Pierre Ossman
9ce5d7c2ad Simplify clipboard handling on Windows by consolidating
it into one central function. 


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9972 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-09-11 11:11:22 +00:00
Manolo Gouy
cbcf0c9312 Fixed STR #2644: support horizontal wheel movement under X11 and MSWindows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9624 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-06-21 08:52:29 +00:00
Manolo Gouy
60d448d150 Removed Fl_Widget::is_fullscreen() that is just another name for Fl_Window::fullscreen_active()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9331 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-09 09:12:34 +00:00
Fabien Costantini
8809c5d65d Fixed build error in msvs because Fl ref to FULLSCREEN enum was not accessible in Fl_Widget. new inline is_fullscreen() getter has been implemented to avoid a build error with (at least) msvc compilers. Fixed a ton of warnings / problems when bilding on windows 64 bits target with ms toolchain. cleaned up about 200 warnings raised when building win74 targets.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-05 05:12:30 +00:00
Manolo Gouy
0b6f546b0f Added support for the additional key of ISO keyboards (aka 102-key keyboards) named FL_Iso_Key.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9303 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-26 16:54:54 +00:00
Manolo Gouy
08ce2e07d3 Fix STR#2641: true fullscreen windows that cover all their screen including menu bar, task bar, dock.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9299 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-23 16:47:53 +00:00
Manolo Gouy
32d4bc4099 Fix STR#2810: removed all uses of function Fl_Device::class_name().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9293 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-18 18:48:29 +00:00
Manolo Gouy
2df4196d8b About STR#2600 : some code factorization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9101 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-09-30 13:09:06 +00:00
Manolo Gouy
c029bba113 Fix STR#2600 for the MSWindow and Mac OS platforms.
A new event FL_SCREEN_CONFIGURATION_CHANGED is introduced.
Fl::add_handler() allows to register a callback for this event.
The unix/X11 implementation is still missing.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9087 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-09-30 08:03:22 +00:00
Albrecht Schlosser
06ec8900f0 Fix window positioning on screen (Fl_X::fake_X_wm()) by testing the
entire window area instead of the top left corner only to find the
screen to put the window on (Windows only).

Note that this *should* be changed to use the work area instead of
the screen area, as discussed in fltk.development.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8983 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-08-19 14:11:30 +00:00
Greg Ercolano
4f4a8fc3c7 Modifications to all LGPL headers for STR #2685.
(to clarify static exception LGPL by changing license references)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19 04:49:30 +00:00
Albrecht Schlosser
6027f410ed Fixed Windows DLL import of fl_xid() (STR #2670)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8821 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-06-18 12:29:49 +00:00
Manolo Gouy
18a902ca31 Fix Fl_Paged_Device::print_window(), Fl_Window::decorated_w() and Fl_Window::decorated_h()
when the window is iconized for all platforms.
Also, factorized some duplicated code in src/Fl_x.cxx.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8759 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-05-30 12:33:51 +00:00
Manolo Gouy
2a9d1e7bec Fix STR #2638. The X11 part is simplified as suggested by Bill.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8710 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-05-21 21:55:59 +00:00
Albrecht Schlosser
3b76848435 Documentation updates, also fixing STR #2574, trying to make clear
which events invisible and inactive widgets can get.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8623 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-24 17:09:41 +00:00
Manolo Gouy
1ad8cf320d Fixed a problem in the WIN32 version of Fl_Paged_Device::print_window_part() and
Fl_Paged_Device::print_window() where the window didn't redraw well in some
cases after printing.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8606 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-18 20:47:32 +00:00
Manolo Gouy
ddc4b21b55 Fixed Fl_Paged_Device::print_window() that did not work under Windows seven.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8595 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-17 08:48:40 +00:00
Manolo Gouy
9ff9cf1230 Added Fl_Paged_Device::print_window() to print a window with its title bar and frame.
Added Fl_Window::decorated_w() and Fl_Window::decorated_h() that return the size
of a window with its title bar and frame.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8593 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-15 21:38:05 +00:00
Fabien Costantini
cc79642a94 Say goodbye to weird comctl32.lib link clause in vc20xx builds. Now embeds it if it is supported, so no need to specify more than fltk libs in new fltk projects ! Makes it similar to other platforms linkage options and will probably improve learning curve of fltk new users. Improvements could be implemented for even easier/transparent linkage (fltk libs, fltk dlls?) of fltk apps.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8461 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-21 18:33:46 +00:00
Manolo Gouy
18156dfb30 Removed global variable fl_surface that was not very useful because equivalent
to Fl_Surface_Device::surface().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8360 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-02 12:42:47 +00:00