Commit Graph

244 Commits

Author SHA1 Message Date
Alexander Larsson
8f6f64fe10 win32: Make WINTAB support work
Lots of rework to make input events work in the csw world
2011-11-01 12:38:15 +01:00
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
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
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
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
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
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
Alexander Larsson
bfe27c0aef win32: Record the native event mask in use 2011-10-19 22:41:13 +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
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
Matthias Clasen
2f8c78ddc5 Deprecate foreign window apis
And add x11- and win32-specific apis for these at the same time
2010-12-21 09:54:14 -05:00
Fridrich Štrba
895b9ff43f A proper fix for win32 build 2010-08-29 18:16:58 +02:00
Fridrich Štrba
af44019baf Revert "Fix windows build of the branch"
This reverts commit c7e650ae5d.
2010-08-29 18:16:19 +02:00
Hans Breuer
707f1a9a84 win32: Further fixing _gdk_window_impl_new()
- attributes->wclass is not consistently set anymore,
   use private->input_only instead [1]
 - don't put window into parent->children a second time
   (now there is no window reference problem anymore)
2010-08-29 14:22:08 +02:00
Fridrich Štrba
c7e650ae5d Fix windows build of the branch 2010-08-28 18:50:45 +02:00
Martin Schlemmer
770e308c42 win32: cummulated backport of xp theme fixes from master 2010-08-28 15:14:31 +02:00
Hans Breuer
068515ad96 Further fix _gdk_window_impl_new() for win32 and ...
Beside fixing _gdk_window_impl_new() as adviced in
http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00214.html
the patch adds implementations for set_background, set_back_pixmap,
restack_under, restack_toplevel and clear_region methods.
2010-08-27 21:23:59 +02:00
Tor Lillqvist
eb21a7df29 Work on OLE2-based generic DND
Intermediate commit of work in progress on integrating the old code
for OLE2-based generic drag and drop from Arhaeopteryx Software, from
a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
as before not compiled in unless OLE2_DND is defined in
gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
style dropping of files on GTK+ apps works.)

Related slight refactoring of other code that shouldn't change how it
works. Add more global variables for run-time constants (once
initialized) representing well-known GdkAtoms and registered Windows
clipboard formats, as they with the generic DND code will be needed in
several source files. Some improved debugging output.
2009-12-16 13:10:21 +02:00
Nicola Fontana
1e1131c959 Do not use static GTypeInfo and GInterfaceInfo
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.

https://bugzilla.gnome.org/show_bug.cgi?id=600158
2009-11-06 01:21:09 +01:00
Tor Lillqvist
ab13c00a38 Use correct size for root window with multiple monitors
The root window width and height have already been correctly
initialised in _gdk_root_window_size_init() to cover all monitors, so
don't incorrectly re-initialise using GetSystemMetrics(SM_C[XY]SCREEN)
which only gives the size of the primary monitor anyway. (See MSDN.)

This fixes at least gdk_screen_get_{width,height}() which indirectly
affects at least the positioning of combo box pop-up menus on multiple
monitors.
2009-10-18 14:35:17 +03:00
Tor Lillqvist
77590e9af7 Add missing newline to debugging output 2009-10-18 14:19:24 +03:00
Tor Lillqvist
be5c06d799 Delete unused leftover static function 2009-10-18 12:08:18 +03:00
Tor Lillqvist
f545bd270d More meaningful debugging output in gdk_win32_window_get_root_coords 2009-10-18 12:06:29 +03:00
Tor Lillqvist
d8de422794 Remove unused variables and static functions 2009-10-18 11:51:57 +03:00
Tor Lillqvist
b92f882ec4 Correct function names in debugging output 2009-10-18 11:45:03 +03:00
Alexander Larsson
5ebb32d1ff Extend _gdk_windowing_window_at_pointer to be able to get toplevels only
This has two advantages:
1) In many backends, this is faster as we can terminate the window
hierarchy traversal earlier
2) When used in gdkdisplay.c::get_current_toplevel() to get the
current toplevel that has the pointer we now correctly return
a toplevel with the pointer in it where the pointer is inside
some foreign subwindow of a toplevel window.

The second advantage fixes some bugs in client side event generation
when the pointer is inside such a foreign child window.
2009-09-28 15:21:54 +02:00
Alexander Larsson
d67a7eda16 Add gdk_window_restack
This lets you restack a window above or below a specified sibling.
At least eclipse wants this functionallity.
2009-09-02 23:38:55 +02:00
Alexander Larsson
cc5b22cc81 Don't update window->shaped from backends
This is properly updated from the main code these days and
should not be touched by the backend code.
2009-08-31 15:06:01 +02:00
Tor Lillqvist
341b8a4752 Initialize missing methods on Windows
Set the input_window_destroy and input_window_crossing methods of the
GdkWindowImplIface on Windows. Add implementation of
_gdk_input_crossing_event that is mostly dummy, though.
2009-08-13 22:49:35 +03:00
Alexander Larsson
939e55223c Ensure that queue_translation is paired with the right X operation
The X11 queue_translation operation uses NextRequest to get the serial
of the XCopyArea operation where the translation should end. However,
if the gc passed to gdk_draw_drawable has a non-flushed clip region
(which it commonly has now for the window clipping) then the next
operation will be the GC flush, not the XCopyArea.

To handle this right we now pass in the GC to be used to
queue_translation and ensure that it is flushed before calling
NextRequest().
2009-08-13 14:46:02 +02:00
Hans Breuer
c5c87a918f Some cursor work for csw(win32), more left to do 2009-07-26 19:14:06 +02:00
Hans Breuer
4d2c165b75 Formatting and removing commented/obsolete code 2009-07-26 19:14:04 +02:00
Alexander Larsson
aa8693f2cb Track viewable for GdkWindow 2009-07-18 23:11:54 +02:00
Hans Breuer
d0cf137ed9 More efficient version of _gdk_win32_window_queue_translation()
Don't create create an extraneous expose event for any scroll operation
that gtk+ does. Thanks to Alex for the hint.
2009-07-17 17:26:48 +02:00
Hans Breuer
e7737dbd19 Implement _gdk_win32_window_destroy() and more cleanup
Implement _gdk_win32_window_destroy() by just renaming
_gdk_windowing_window_destroy(), removed superfuous stub.

Also cleaned up implementations of  gdk_win32_window_set_background()
and gdk_win32_window_set_back_pixmap() - removed stuff now done at the
respective gdk_window_*() function.
2009-07-13 09:45:07 +02:00
Hans Breuer
e96c161643 Implement _gdk_win32_window_queue_translation() 2009-07-13 09:45:06 +02:00
Hans Breuer
b72960f12d Bug #588388 - shape rendering is back
Just mapping exisiting implementations to new GdkWindow API.

http://bugzilla.gnome.org/show_bug.cgi?id=588388
2009-07-13 09:45:05 +02:00
Hans Breuer
7e116727d7 Fix condition to deliver root coords 2009-07-04 12:19:12 +02:00
Hans Breuer
23b1b350b0 Enable window creation with GDK_WINDOW_CHILD again 2009-07-04 12:19:11 +02:00
Alexander Larsson
b1df568239 Some win32 cleanups 2009-07-01 12:06:57 +02:00
Alexander Larsson
5341efd4d4 Make win32 backend build and minimally work 2009-07-01 10:28:06 +02:00
Cody Russell
f4331caf83 grabs 2009-04-02 10:16:30 +02:00
Cody Russell
49a0ec6e95 Updates 2009-04-02 10:16:30 +02:00