Commit Graph

817 Commits

Author SHA1 Message Date
Dieter Verfaillie
4e10d9604b win32: fix some typos 2011-11-10 17:41:12 +01:00
Alexander Larsson
52be8cb9e9 win32: Fix some warnings 2011-11-10 17:41:11 +01:00
Alexander Larsson
65002208b9 win32: Ensure newly mapped toplevels are inside the workarea
This is what e.g. metacity does, and its needed to e.g. get the inital
position of the gimp dock window right.
2011-11-10 17:41:10 +01:00
Alexander Larsson
c563765574 win32: Fix placement at initial position
Positioning windows at 0,0 post creation failed, because it
was mapped with CW_USEDFAULT, but private->x/y still said 0,
so moving it to 0,0 did nothing. We now always position the
window at the right place, even when not mapped, but we
create it at CW_USEDEFAULT initially and store that position
before moving it to the right place.

This fixes the window sizing test in testgtk and the inital
position for the gimp toolbar.
2011-11-10 17:41:10 +01:00
Alexander Larsson
d441044569 win32: Fix synaptics trackpad issues
The synaptics trackpad driver has some weird behaviour on scroll.
It pops up a window over the mouse pointer (looking like a scrollbar).
This has two problems:
* We get extra enter/leave events for the trackpad window
* We get back the trackpad window when we look for the window
  under the mouse to deliver the mousewheel message.

So, we add some trackpad specific hacks to avoid this (sigh) based
on the trackpad window window class.

This fixes bug #542777 and was partially based on a patch there
from Peter Clifton.
2011-11-10 17:41:09 +01:00
Alexander Larsson
487ace0aca 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-11-10 17:41:08 +01:00
Alexander Larsson
1737ffeeb9 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-11-10 17:41:07 +01:00
Alexander Larsson
2788efeb5e 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-11-10 17:41:07 +01:00
Alexander Larsson
a1828e8b60 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-11-10 17:41:06 +01:00
Alexander Larsson
d27b402a85 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-11-10 17:41:06 +01:00
Alexander Larsson
2662fe37df 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-11-10 17:41:05 +01:00
Alexander Larsson
2dbc05f756 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-11-10 17:41:04 +01:00
Alexander Larsson
4c061a5270 win32: By default, allow windows larger than the screen 2011-11-10 17:41:04 +01:00
Alexander Larsson
6be876cdea 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-11-10 17:41:03 +01:00
Alexander Larsson
820721500b 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-11-10 17:41:03 +01:00
Alexander Larsson
4690aa28d0 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-11-10 17:41:02 +01:00
Alexander Larsson
725379192d win32: Make set_keep_above work also for non-mapped windows
This fixes bug #171456
2011-11-10 17:41:01 +01:00
Alexander Larsson
ab615105b6 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-11-10 17:41:01 +01:00
Alexander Larsson
8f50944904 win32: Send initial configure
We need to send a configure event when a window is shown.
2011-11-10 17:41:00 +01:00
Alexander Larsson
36a28d616f 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-11-10 17:41:00 +01:00
Alexander Larsson
538ab4fca7 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-11-10 17:40:59 +01:00
Alexander Larsson
429bd4e5d5 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-11-10 17:40:59 +01:00
Alexander Larsson
ad374a595c 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-11-10 17:40:58 +01:00
Alexander Larsson
66f7e5d163 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-11-10 17:40:57 +01:00
Dieter Verfaillie
1df95b4c0a 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-11-10 17:40:55 +01:00
Alexander Larsson
d66ad8c39d win32: 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-11-10 17:40:55 +01:00
Alexander Larsson
73c527aef0 win32: Record the native event mask in use 2011-11-10 17:40:54 +01:00
Alexander Larsson
321acc3286 win32: 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-11-10 17:40:53 +01:00
Alexander Larsson
f0f7c07f4d win32: Handle implicit grabs 2011-11-10 17:40:53 +01:00
Alexander Larsson
6668ba6914 win32: Update input device code to use the new property names in constructor 2011-11-10 17:40:52 +01:00
Alexander Larsson
ade6d093e2 win32: Fix up initialization order of input subsystem
We were getting warnings due to windows being created before input
subsystems were fully initialized.
2011-11-10 17:40:51 +01:00
Dieter Verfaillie
5406955f7c 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-11-10 17:40:51 +01:00
Dieter Verfaillie
86b8a1ddc8 win32: dnd should not be registerd for offscreen windows
https://bugzilla.gnome.org/show_bug.cgi?id=616544
2011-11-10 17:40:50 +01:00
Peter Clifton
05e982a11a 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-11-10 17:40:50 +01:00
Peter Clifton
f9d8f9758b Win32: Ensure native back-end for windows where the user requests their handle
https://bugzilla.gnome.org/show_bug.cgi?id=658841
2011-11-10 17:40:49 +01:00
Chun-wei Fan
b18718ac7e 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-11-10 17:40:49 +01:00
Marc-André Lureau
1afc29d869 win32: resurect Windows clipboard selection notification
This is a rewrite of e6fa7394ba, with
misc fixes that should help with some bugs Tim was talking about.

https://bugzilla.gnome.org/show_bug.cgi?id=652239
2011-11-10 17:40:48 +01:00
Hans Breuer
db19fbd45c win32: Resurrect some enter/leave notify events for native windows
The button highlighting in testgtk works again, even with
GDK_NATIVE_WINDOWS. Unfortunately testgtk:menus still does
not work for the forced-native-window-case.
2011-11-10 17:40:47 +01:00
Neil Roberts
7445a59a9a win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos
In _gdk_window_move_resize_child it tries to decide whether to pass
SWP_NOSIZE and SWP_NOMOVE based on whether the new size and position
is different from the window's existing position. However it seems
that GDK now ends up updating the window's position before calling
_gdk_window_move_resize_child so this would mean it would think the
window never changes size or position so SWP_NOSIZE|SWP_NOMOVE would
always be set. This causes child windows to never be resized.

This patch changes it so that it never passes either flag to
SetWindowPos. I don't know whether this will cause any side effects
but you'd think it shouldn't do any harm to reassert the current size.

https://bugzilla.gnome.org/show_bug.cgi?id=628049

Signed-off-by: Hans Breuer <hans@breuer.org>
2011-11-10 17:40:47 +01:00
Matthias Clasen
32884e9c16 win32: Adapt to GdkWindowImpl api change 2011-11-05 01:11:18 -04:00
Michael Natterer
5b74ee38e8 gdk: fix gdk_keyval_to_lower/upper() for Quartz, Win32 and Broadway
In 2.x, the !HAVE_XCONVERTCASE fallback of keyval_convert_case() was
implicitly used as implementation for all !X11 backends.

In 3.x, when this function was virtualized in GdkDisplayManager,
this fallback was moved to the X11 backend and the other backends
"equipped" with /* FIXME implement */ implementations of
keyval_convert_case() which don't convert anything.

Move the fallback code back to gdk/ as default implementation
of GdkDisplayManager::keyval_convert_case() and remove its
implementations is all backends but X11. Also remove the
implementation in Wayland which was a plain copy of what
is now the default implementation.
(cherry picked from commit f46c1b76d8)
2011-10-07 16:19:41 +02:00
Greg Hellings
bd26ce1db6 Install gdk/win32 headers
Added install commands for the gdk/win32 headers as referenced from
gdkwin32.h.

https://bugzilla.gnome.org/show_bug.cgi?id=653964
2011-08-15 13:00:14 +03:00
Javier Jardón
32e00d1f43 Use AM_CPPFLAGS instead the obsolete INCLUDES 2011-07-06 15:58:32 +01:00
Javier Jardón
7c688cb8a6 gdk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Chun-wei Fan
d07907d2de Update Windows Resource template information 2011-06-07 11:16:57 +08:00
Carlos Garnacho
db74a6e816 GdkDevice: Remove duplicate private function
_gdk_device_get_axis_use() dates back to pre-sealing, when the
xi2 work began, this remaining can be gone with a public
gdk_device_get_axis_use() function already in place.
2011-04-08 16:39:45 +02:00
Alexander Larsson
a3b2840cae Remove support for GDK_NATIVE_WINDOWS
GDK_NATIVE_WINDOWS was a way to keep some old apps running that did weird
things in gtk2. We should not have to carry this forwards in gtk 3.x.

We do however keep a g_warning() call reminding people of this fact to
ease debugging when they try to port their applications.

https://bugzilla.gnome.org/show_bug.cgi?id=644119
2011-03-08 23:13:39 +01:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Tor Lillqvist
acc01ac944 Tweak include order a bit to get around compilation errors
wintab.h defines an INT() macro that interfers with some lines in
commctrl.h.
2011-02-20 23:56:13 +02:00
Tor Lillqvist
8e6932f46e Handle emulated keyboard input that arrives as VK_PACKET
Fixes bug #642772. Thanks to the anonymous bug reporter for providing
a test program.
2011-02-20 01:39:13 +02:00