Commit Graph

3426 Commits

Author SHA1 Message Date
Alexander Larsson
26b97f63c9 win32: Add gdk_win32_window_get_impl_hwnd
This is needed to fix the ms-windows theme not to create
native windows for all child windows.
2011-10-28 11:05:53 +02:00
Alexander Larsson
4b5b28b64f win32: Fix modal_hint handling
Modal hints are not really a stack. All windows that are modal
are allowed to get input, not just the top one.

This fixes bug #604156
2011-10-27 22:13:54 +02:00
Alexander Larsson
6d1b818560 win32: Don't use API_CALL for SetWindowLong
This can return 0 without it being an error.
Should fix the last issue with bug #142874
2011-10-27 21:12:32 +02:00
Alexander Larsson
47095f97d2 win32: Make flush/sync work like in X
gdk_flush() should gdk_display_sync() on all open displays.

Both for display_flush and display_sync it seems useful to call
GdiFlush, but we don't have anything extra to do for display_sync,
as there is no inherent roundtrip on win32.

This should close bug #84314
2011-10-27 21:12:31 +02:00
Alexander Larsson
8588944cb9 win32: Add custom placements for some window types
Windows with transients: center on parent
Splash screens: center on monitor
Also properly ignores initial moves of unmapped
windows that are not override redirect or HINT_POS

Fixes bugs #324254 and #612359
2011-10-27 21:12:24 +02:00
Alexander Larsson
ac00340d4c win32: More robust way to ensure we get a configure event after move/resize
There were still cases where we didn't get a WINDOWPOSCHANGED after
a SetWindowPos() call, like e.g. with a larger minimum size than
the set size (bug #574935)

So, we revert the previous fix and now just always manually emit
a configure notify after the move_resize call. Also, we inhibit
the WINDOWPOSCHANGED configure event during the move_resize operation
to avoid multiple Configures.
2011-10-27 10:42:07 +02:00
Alexander Larsson
f44c6d66bf win32: Ensure we always send a configure event when changing size/pos
There are some cases where we don't get a WINDOWPOSCHANGE such that
we generate a configure event, even if we called gdk_window_move_resize()
or similar. For instance:
* The window is fullscreen
* The window is maximized
* The specified pos/size is the same as the current one

However, as per X11 ConfigureNotify semantics we *always* want one, or
we could run into issue like e.g. bug #537296 where we're waiting for
the CONFIGURE to call gdk_window_thaw_toplevel_updates_libgtk_only().
2011-10-26 21:46:19 +02:00
Alexander Larsson
4f9e1dd414 win32: By default, allow windows larger than the screen 2011-10-26 21:44:49 +02:00
Alexander Larsson
8c9963f9c3 win32: Fix size or style changes during fullscreen
When we're fullscreen we should update the cached hints, and we
should not apply the normal hints to the style.

This fixes bug #516822
2011-10-26 20:45:00 +02:00
Alexander Larsson
9c575532fd win32: Use WM_NCDESTROY instead of WM_DESTROY
WM_NCDESTROY gets called after children are destroyed, which is
the semantics DestroyNotify has in X11.
2011-10-26 12:45:09 +02:00
Alexander Larsson
9da34d0ec5 win32: Don't remove the window from the handle table on destroy
We always get the WM_DESTROY message anyway, and we remove it there.
Bug #336416 even claims this could be a leak if the WM_DESTROY
message was not seen before the DestroyWindow call returned, as
the WM_DESTROY message could not be handled later without the
window in the handle table. I'm not sure this can happen, but we
might as well remove it.
2011-10-26 12:45:06 +02:00
Alexander Larsson
0c0c741885 win32: don't input_window_destroy twice
The common code already calls input_window_destroy
2011-10-26 12:45:04 +02:00
Alexander Larsson
7b425eead7 win32: Make set_keep_above work also for non-mapped windows
This fixes bug #171456
2011-10-26 12:44:54 +02:00
Alexander Larsson
d463030660 win32: Send window-state-changes before configure events
This is requires to that the state of the window is right when
you get the configure event (and to match what X does).

Fixes bug #169811
2011-10-26 10:26:38 +02:00
Alexander Larsson
cd7fa0385c win32: Send initial configure
We need to send a configure event when a window is shown.
2011-10-25 16:41:52 +02:00
Alexander Larsson
5bd8485a3d win32: Ignore client requested window move/size during SIZEMOVE
This will just be fighting the user like in e.g.
https://bugzilla.gnome.org/show_bug.cgi?id=64428
2011-10-25 16:13:47 +02:00
Alexander Larsson
c87114cb14 win32: Remove most special casing of WINPOSCHANGED during modal ops
There is no particular reason to special case this, we want to handle all
sort of normal events. The only special thing we keep is that
as an optimization we pump the message loop extra during a WINPOSCHANGED
in a modal operation as that will cause us to repaint faster.

Also, bump the arbitrary number of mainloop iterations for the timer.
I don't see why we need it at all, but at least doing more than one
iteration if needed should be nice.
2011-10-25 15:36:13 +02:00
Alexander Larsson
b0d108a5c4 win32: Fix missed resize exit message
When you start a window resize or move via the window menu and
don't actually change anything we're not getting an exitsizemove.
In order to work around this we also look for WM_CAPTURECHANGED.
2011-10-25 15:34:22 +02:00
Alexander Larsson
2dfd498fd8 win32: Handle all window changes in WINDOWPOSCHANGED
This moves all the code from WM_SIZE, WM_MOVE, and WM_SHOWWINDOW into
one place, cleans up the code and makes sure we only send a single
configure event even if both size and position changes.
2011-10-25 14:38:16 +02:00
Alexander Larsson
e2d3bdf68c win32: Fix up window_show
We don't pass in raise anymore, but already_mapped.
Also, already_mapped must be used rather than MAPPED, as we already
synthesize the MAPPED in the generic code (and thus we don't have
to synthesize it again).
2011-10-25 14:26:22 +02:00
Dieter Verfaillie
12507a7cc2 win32: Call GetQueueStatus instead of PeekMessage PM_NOREMOVE
Calling PeekMessage can cause reentrant calls into the window procedure
for sent (as opposed to posted) messages, so its not safe to call
when we're not expecting reentrancy. Instead we call GetQueueStatus
when we're just looking for availible messages.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=552041
2011-10-21 11:38:31 +02:00
Alexander Larsson
039f5fdfb5 Better crossing events and grab destination reporting
We new report to the right window during !owner_event grabs, and
we send proper enter and leave events.
2011-10-19 22:41:14 +02:00
Alexander Larsson
bfe27c0aef win32: Record the native event mask in use 2011-10-19 22:41:13 +02:00
Alexander Larsson
c6cab74920 Use right native_window for implicit grabs
The native grab really is on the window that got the button press event.
2011-10-19 22:41:12 +02:00
Alexander Larsson
b34ff7b3ea in window_at_pointer, ensure that we handle non-client areas correctly
We should not return a window if the pointer is in the non-client area,
like the titlebar.
2011-10-19 22:41:10 +02:00
Alexander Larsson
a4288a88f4 Handle implicit grabs 2011-10-19 22:41:08 +02:00
Alex Corrado
fff25d3a3a Quartz, Bug 655057: Eliminate Compiler Warning
When compiled with older SDKs, the original change for this bug caused a
compiler warning about NSWindow not being able to handle a setStyleMask
message. This tricks the compiler into thinking that it can.
2011-10-09 09:52:14 -07:00
Kristian Rietveld
b3314acd97 quartz: also update window position on windowDidResize
When a window goes fullscreen, the resize also changes its size.
2011-10-08 11:28:44 +02:00
Michael Natterer
5a5d6d28c2 quartz: my last commit had merge junk in it, sorry 2011-09-28 19:01:01 +02:00
Michael Natterer
931a228ce0 quartz: don't filter away directly encoded 24-bit UCS characters
gdk_unicode_to_keyval(uc) returning (uc | 0x01000000) is not an
error return value but simply the way to encode 24-bit unicode
characters directly as keyvals.
2011-09-28 13:56:36 +02:00
Dieter Verfaillie
f333c9dc23 win32: Fix DnD when drag icon is below the pointer
By reverting gdk_drag_find_window_for_screen logic to what it was
before eb21a7df29.
The old logic knew how to ignore drag_window when searching
for dest_window, but that code was removed (I guess by accident).

https://bugzilla.gnome.org/show_bug.cgi?id=616544
2011-09-27 22:22:14 +02:00
Dieter Verfaillie
c608ee0092 win32: dnd should not be registerd for offscreen windows
https://bugzilla.gnome.org/show_bug.cgi?id=616544
2011-09-27 22:22:01 +02:00
Peter Clifton
7ee5e4f2c6 Win32: Fix _gdk_windowing_window_at_pointer to correctly return a toplevel
Commit 5ebb32d1ff didn't add the correct
code to find the toplevel window. The WindowFromPoint() function does
not return the toplevel window in the hierarchy, it returns the deepest
non-disabled, non-invisible child. As we don't use invisible or disabled
windows, we don't actually need to use the ChildWindowFromPoint walk for
the non get_toplevel case, so we can remove that code path.

To find a toplevel, we need to start from the desktop and work up, using
ChildWindowFromPointEx (to ignore invisible and disabled windows). If we
don't ignore invisible and disabled windows (as is the case with the
ChildWindowFromPoint call, we are liable to get returns of hidden or
disabled children of the desktop which don't belong to us, but notionally
occupy the same area under the pointer.

An alternative might be to start our walk with one of the children of the
desktop owned by our process and thread - which we can enumerate using,
the EnumThreadWindows call, or (presumably) determine internally. This
would not work when we are inside a GtkSocket though, as the children of
the desktop would belong to the process owning the GtkPlug - we would
have to rely on our own list of windows.

For correctness, this commit adds tests to ensure that we don't try to
return either x or y window coordinates if that corresponding pointer is
NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=658842
2011-09-27 09:18:37 +02:00
Peter Clifton
fd01442c7e Win32: Ensure native back-end for windows where the user requests their handle
https://bugzilla.gnome.org/show_bug.cgi?id=658841
2011-09-27 09:15:36 +02:00
John Ralls
81c2166eb9 Quartz: Fix a typo and a compilation warning 2011-09-25 14:44:54 -07:00
John Ralls
94fc15ad95 Bug 653450 - gtkfilechooser crashes when added favorite
Ensure that display is set during drag-and-drop, and that string lists'
memory is zeroed after allocation to prevent g_strfreev() from
over-running.
2011-09-24 10:56:05 -07:00
John Ralls
10352d63af Fix typo in 24a7e798 2011-09-23 15:00:03 -07:00
John Ralls
224a7e798a (Backport acf1345) Fix refresh of static autorelease_pool so that it doesn't happen in gtk-nested loops. 2011-09-23 14:03:59 -07:00
Steffen Gutmann
33154e1c7d Bug 659907 - gdk_quartz_draw_opaque_stippled_pattern crashes 2011-09-23 09:03:36 +02:00
Michael Natterer
5e602ab0f2 quartz: resolve the modifier confusion on the Mac
- map Alt/Option to MOD1
- map Command to MOD2
- map MOD2 to the virtual Meta
- improve/fix (?) group handling in gdkkeys-quartz.c
2011-09-16 15:54:03 +02:00
John Ralls
45d61a5fd6 Bug 617583 - Dead accents keys don't work in GTK+ applications on OSX
Handle dead keys in special_ucs_table and have them converted by
UCKeyTranslate(), so all dead key combinations can be entered.
Later, this should be handled in the input method, just as it's
done for X11/Win32.
2011-09-09 10:12:40 +02:00
Tor Lillqvist
d2d6caf00a Remove superfluous call to _gdk_event_button_generate()
Fixes bug #630962.
2011-09-05 01:33:29 +03:00
John Ralls
a2a85a194c Bug 655122: Lion crashes during resize.
Move resizing detection to a separate function and detect resizes so that they don't result in grabs (which was causing the crash).
2011-08-13 14:11:29 -07:00
John Ralls
9edc6ca045 Bug 655122: Detect OSX version for handling version-dependent special cases (the one in question is resizing, which OSX 10.7 allows on all edges instead of the lower-right corner as on previous versions) 2011-08-13 13:55:08 -07:00
John Ralls
a90d9da9e9 Bug 655087: Prevent drqwing when there are no rectangles in which to draw. 2011-08-13 13:20:22 -07:00
Kristian Rietveld
468deb67d5 quartz: Remove MAC_OS_X_VERSION_MIN_ALLOWED ifdef
I tried to suppress compiler warnings on pre-10.6 machines this way,
but it defeats its purpose when you compile for pre-10.6 machines on
a 10.6 machine.  For now, we have to live with the warnings when
compiling on/for pre-10.6 machines, there does not seem an easy and proper
way to suppress the warnings.
2011-08-12 23:22:03 -07:00
Michael Hutchinson
5c73ebf54c Bug 655074 - Fix crash with undecorated windows on MacOS Lion 2011-07-25 09:21:09 -04:00
Chun-wei Fan
8f8da26c18 Update Visual C++ compilation items
-Added Visual C++ 2010 project files.  They are like the VS 2008 projects
 where the GDK and GTK+ projects are filled-in templates, which are filled-
 in during 'make dist', and added related README.txt file, and add them
 into distribution
-Updated the VS 2008 README.txt to reflect the latest situation regarding
 dependencies etc.
-Updated README.win32 to tell people about the now-available VS2010 projects
-Updated config.h.win32.in as VS 2010 ships with stdint.h
2011-07-25 12:20:21 +08:00
Matthias Clasen
d7ac9cd71c Revert "gdk: Make background changes queue a repaint"
This reverts commit 254b9a4c54.
2011-06-20 08:10:49 -04:00
Chun-wei Fan
d0aa7ffc61 Add G_ENABLE_DEBUG #ifdef check in gdkdisplay-win32.c
Commit 88707e6912 used
_gdk_win32_cf_to_string, which is only defined when G_ENABLE_DEBUG
is defined, so add G_ENABLE_DEBUG #ifdef around that part.
2011-06-16 13:48:56 +08:00