Commit Graph

929 Commits

Author SHA1 Message Date
Michael Natterer
427b88f541 GdkScreen: fix precondition checks in the public API
Move g_return_if_fail() stuff from the backends to the public
functions in gdkscreen.c itself, and some fixes for ugly formatting in
the various gdkscreen-backend.c files.
2012-02-21 17:19:35 +01:00
Dieter Verfaillie
fe1907708c win32: fix gdk_win32_window_raise
When calling gtk_window_present(), gdk_win32_window_raise did not
actually raise the window anymore. Replacing BringWindowToTop() with
SetForegroundWindow() fixes this.

During testing, we also discovered that sometimes SetForeGroundWindow()
will (correctly) refuse to raise the window and fail(for example: sometimes
when dragging a different application at the time of a gtk_window_present()
call). To prevent a GdkWarning from being produced, usage of the API_CALL
macro has been removed for this case.

Additional goodies of SetForeGroundWindow:
- it brings the window to the front when the process owning the
  window to raise is the foreground process (for example when
  gtk_window_present is called from a GtkStatusIcon's activate
  signal handler)
- it limits itself to flashing the task bar button associated
  with the window if the process owning the window to raise
  is *not* the foreground process (for example when gtk_window_present
  is called from a g_timeout_add callback function)

https://bugzilla.gnome.org/show_bug.cgi?id=665760
2012-01-25 20:32:50 +01:00
Matthias Clasen
c6df2828b7 Add gdk_screen_get_monitor_workarea
The function returns the part of a monitors area that should be
used for positioning popups, menus, etc. The only non-trivial
implementation atm is in the X backend, all the other backends
just return the full monitor area. The X implementation is
currently suboptimal, since it requires roundtrips to collect
the necessary information. It should be changed to monitor
the properties for changes, when XFixes allows to monitor
individual properties.
https://bugzilla.gnome.org/show_bug.cgi?id=641999
2011-12-18 14:29:16 -05:00
Alexander Larsson
62b505174f win32: Make all GDK_WINDOW_TEMP always on top
This makes menus, popups and tooltips show above the windows
task bar.
2011-11-25 11:22:59 +01:00
Alexander Larsson
9275b87b6a win32: Don't double free stuff when finalizing drag context
We were freeing stuff that was already freed in the parent class
finalizer.
2011-11-21 15:03:53 +01:00
Alexander Larsson
0d94b974b3 win32: Don't dereference keyboard_grab if it is NULL
This fixes a crash in e.g. testdnd
2011-11-21 14:37:57 +01:00
Alexander Larsson
4760b3e2bd win32: Make gdk_drag_context_new static 2011-11-21 14:34:06 +01:00
Dieter Verfaillie
2fb8b97b65 win32: get rid of GdkDragContextPrivateWin32 and related machinery.
This turns GdkWin32DragContext into a proper GdkDragContext subclass.
Because we now correctly initialize GdkWin32DragContext in
gdk_drag_context_new, we no longer crash immediatly when a DnD
operation is initialized (the find_window, drag_status, ... vfuncs
where all pointing to 0x0 instead of their proper win32 implementations).

We now try to consistently refer to GdkDragContext as "context",
GdkWin32DragContext as "win32_context" and the ole2 related
target_drag_context and source_drag_context as "ctx".

Members of GdkWin32DragContext only used by the ole2 DnD codepaths
are now explicitly marked with a ole2_dnd_ prefix.
2011-11-21 14:34:06 +01:00
Alexander Larsson
361fcabbde win32: make fixup_event correctly ref all GdkWindow members
This fixes some crashes related to owner changes and selections.
2011-11-17 12:25:56 +01:00
Alexander Larsson
a2b879fe53 win32: Make grab cursors work again 2011-11-10 21:32:50 +01:00
Alexander Larsson
2f14732b1d win32: Fix gdk_win32_window_translate
We now do proper handling of existing invalid regions, and
we use ScrollDC which allows us to specify the right clip
region rather than just the bounding rect.
2011-11-10 17:41:13 +01:00
Dieter Verfaillie
68d28aad97 win32: fix pasting screenshots taken with PrintScreen or Alt+PrintScreen
These are found on the clipboard in the biCompression == BI_BITFIELDS &&
biBitCount >= 16 format. In this case the BITMAPINFOHEADER is followed
by three DWORD specifying the masks of the red green and blue components,
but bfOffBits was not being adjusted accordingly.

Based on Massimo's comment on bug 631384 and verified on
http://msdn.microsoft.com/en-us/library/dd183386%28v=VS.85%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=631384
2011-11-10 17:41:12 +01:00
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
Hans Breuer
b41ee31a16 win32: no more GdkNativeWindow and related changes
- replace GdkNativeWindow with HWND, remove type casts
 - no more GdkDisplayClass::get_drag_protocol but GdkWindowImpl::get_drag_protocol
 - remove *_client_message*()
2011-02-06 15:07:13 +01:00
Fridrich Štrba
a79f05c7be fix win32 build after removal of the colormap debug category 2011-01-21 11:20:16 +01:00
Benjamin Otte
ec750bed0c gdk: Remove colormap debug category
We don't have colormaps anymore.
2011-01-21 02:54:09 +01:00
Fridrich Štrba
a606ea62a1 Fix win32 build 2011-01-11 17:28:37 +01:00
Hans Breuer
f605d3d698 Bug 639127 - Add missing gdkdisplaymanager-win32.c 2011-01-10 21:39:33 +01:00
Matthias Clasen
9f13312520 Fix file lists in the win32 backend 2011-01-05 09:58:46 -05:00
Hans Breuer
1d838f586c win32: gdk3 resurrection
There are sure regressions but basic stuff seems to be working
again after all the API breakage done with comments like
"Win32 and Quartz need to be ported still."
2011-01-02 13:33:04 +01:00
Benjamin Otte
3036922b3d gdk: Create windows via _gdk_display_create_window()
THe use of this function will become visible in the next commits. But
wrapping g_object_new() is a generally a good idea anyway.
2010-12-21 12:07:08 -05:00
Benjamin Otte
4793bd3399 gdk: Move gdk_cursor_get_display() out of the backends
Now that we store the display inside the cursor, that change is obvious.
2010-12-21 12:07:05 -05:00
Matthias Clasen
2650328ea8 Add win32 implementation for foreign window functions 2010-12-21 12:07:04 -05:00
Matthias Clasen
10e23de49e Drop sm_client_id win32 implementation 2010-12-21 12:07:04 -05:00
Matthias Clasen
2186203422 Remove unused get_offsets functions from headers 2010-12-21 12:06:59 -05:00
Matthias Clasen
ec9c97752d Work toward turning GdkDisplayManager into a backend singleton
This commit hides the GdkDisplayManager instance and class structs,
adds vfuncs for listing displays, opening displays, and getting and
setting the default display. The X11 backend has a derived
GdkDisplayManagerX11.

The gdk_display_manager_get() function is responsible for deciding on
which of the compiled in backends to use. Currently, it consults the
GDK_BACKEND environment variable and falls back to x11.
2010-12-21 12:06:57 -05:00
Matthias Clasen
9a1cc81acb Add a vfunc to replace _gdk_windowing_window_destroy_foreign
All backends updated.
2010-12-21 12:06:57 -05:00
Matthias Clasen
1e694b4dd8 Add a vfunc for gdk_window_set_composited 2010-12-21 12:06:57 -05:00
Matthias Clasen
c53ec081ce Add vtables for DND
This commit hides GdkDragContext and GdkDragContextClass, adds
vfuncs for most drag context functionality, and turns the X11 DND
implementation into GdkDragContextX11. We also add vfuncs to
GdkDisplay for gdk_drag_get_protocol and to GdkWindow for
gdk_drag_begin, and implemenet them for X11.
Other backends need similar treatment and are broken now.
2010-12-21 12:06:56 -05:00
Matthias Clasen
06f75b3727 Make GdkAppLaunchContext display-dependent
Add a GdkDisplay::get_app_launch_context vfunc, and a
gdk_display_get_app_launch_context that for X11 returns a subclass.
For win32 and quartz, the implementations were trivial, so we
just return a new GdkAppLaunchContext without subclassing. Since
the type of the context now depends on the display,
gdk_app_launch_context_set_display is deprecated.
2010-12-21 12:06:55 -05:00
Matthias Clasen
de84a7b14f Move gdk_window_lookup to common code 2010-12-21 12:06:55 -05:00
Matthias Clasen
31cd046cd0 Move gdk_add_client_message_filter to common code 2010-12-21 12:06:55 -05:00
Matthias Clasen
8075cfd658 Move gdk_get_display to common code 2010-12-21 12:06:55 -05:00
Benjamin Otte
d55073fde6 gdk: Remove depth argument from GdkWindowImpl->get_geometry() 2010-12-06 01:02:52 +01:00
Benjamin Otte
f9a9567731 gdk: Replace direct calls of _gdk_event_func with _gdk_event_emit()
For now that function just calls the event func.
2010-12-02 20:21:05 +01:00
Benjamin Otte
4d1604c77d gdk: Move window beeps into GdkWindowImpl
One less magic function. Also refactored it to make it easier to
implement. It now returns TRUE if it beeped and FALSE if it failed to do
so. A default implementation exists that just returns FALSE for all the
backends that can't beep windows (read: everything but X11 with XKB -
and why on earth do keyboard libs implement beeping?)
2010-12-02 20:21:05 +01:00
Benjamin Otte
1269f8424f gdk: Make get_shape and get_input_shape vfuncs
Trying to get rid of all the _gdk_windowing_something() functions that
we expect backends to magically know about and instead put them in a
proper interface (mostly GdkWindowImplClass).
2010-12-02 20:21:04 +01:00
Benjamin Otte
3494f87a10 API: Remove GdkNoExposeEvent
It's not used by anyone and not supported by any backend but X11.
2010-12-02 20:21:04 +01:00
Benjamin Otte
17a0a467a1 gdk: Pass the GdkWindow to resize_cairo_surface vfunc
So it's in sync with all the other vfuncs.
2010-12-02 20:21:04 +01:00
Benjamin Otte
370d272b13 gdk: Remove _gdk_window_impl_get_type() function
It was only used in the backends, and they can use the correct type
directly.
2010-12-02 20:21:03 +01:00
Benjamin Otte
62622a94ae gdk: Pass Drawable as argument
We're not passing a GdKWindow here, but the implementation.
2010-12-02 20:21:02 +01:00
Benjamin Otte
d154344a43 win32: Remove some unused defines 2010-12-02 20:17:28 +01:00
Tor Lillqvist
290ecb0aba Fix compilation breakage in gdk/win32 2010-11-24 14:26:53 +02:00
William Jon McCann
323df2b280 Make gdk_event_apply_filters safe against changes in filter list
An event filter may add or remove filters itself.  This patch does
two things to address this case.  The first is to take a temporary
reference to the filter while it is being used.  The second is
to wait until after the filter function is run before determining
the next node in the list to process.  This guards against
changes to the next node.  It also does not run functions
that have been marked as removed.  Though I'm not sure if this
case can arise.

https://bugzilla.gnome.org/show_bug.cgi?id=635380
2010-11-22 13:16:24 -05:00
Bastien Nocera
7a52b1df67 gdk: Add XSetting for "gtk-cursor-blink-timeout"
Otherwise the blink timeout is the one used by default in GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=634697
2010-11-12 19:11:21 +00:00
Tor Lillqvist
1e9c091457 Avoid a compiler warning 2010-11-06 13:13:37 +02:00
Tor Lillqvist
6e56d05cbc Drop unused static function 2010-11-06 13:13:10 +02:00
Michael Natterer
a1134e5622 gdk: change signature of gdk_device_get_history() back to what it used to be
"n_events" went back from guint to gint.
2010-10-19 13:30:42 +02:00
Tor Lillqvist
e346d26f70 Make it compile again for Windows 2010-10-07 01:28:47 +03:00
Kristian Rietveld
eca2af5230 Make set_cairo_surface_size a vfunc on GdkWindowImpl
Note the special implementation of this method on GdkOffscreenWindow
that makes sure its current surface is not destroyed.
2010-10-05 15:38:23 +02:00
Benjamin Otte
0a57863f73 win32: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
e624656c20 API: Remove GdkColormap 2010-09-26 15:11:34 +02:00
Benjamin Otte
cf4cb4f6d9 API: Remove colormap handling from GdkScreen
In particular, the following functions are gone:
- gdk_screen_get_default_colormap()
- gdk_screen_set_default_colormap()
- gdk_screen_get_system_colormap()
- gdk_screen_get_rgba_colormap()
2010-09-26 15:11:34 +02:00
Benjamin Otte
04d5c477aa API: Remove gdk_drawable_get_colormap()
And with it, remove any notion of colormaps from GdkWindow. In
particular, X11 windows will now not set attrs.colormap when calling
XCreateWindow.
2010-09-26 15:11:33 +02:00
Benjamin Otte
f08254074c API: Remove colormap member from GdkWindowAttr
Also remove all code that cares about differing colormaps for child
windows.
2010-09-26 15:11:33 +02:00
Benjamin Otte
b5097de481 gdk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
a6ef356107 API: Remove drawable getters for visual, screen and depth
Removed and replaced are:
gdk_drawable_get_visual() => gdk_window_get_visual()
gdk_drawable_get_screen() => gdk_window_get_screen()
gdk_drawable_get_depth()  => gdk_visual_get_depth
                                          (gdk_window_get_visual())
2010-09-26 15:11:33 +02:00
Benjamin Otte
a6e936788a gdk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Benjamin Otte
eee6c002d1 gdk: store the visual in the GdkWindowObject 2010-09-26 15:11:32 +02:00
Benjamin Otte
894d402c0f API: Remove gdk_drawable_set_colormap() 2010-09-26 15:11:32 +02:00
Benjamin Otte
522becccc0 gdk: Remove pixmap debug category
It's not used anywhere anymore.
2010-09-26 15:11:30 +02:00
Benjamin Otte
f74f9b2766 gdk: Remove GdkPixmap
All iusers of it are gone, so it's now time to let go.
cairo_surface_t is a full replacement, combined with
gdk_window_create_similar_surface().
2010-09-26 15:11:30 +02:00
Benjamin Otte
2bedd205c5 gdk: Remove gdk_windowing_create_cairo_surface()
Instead, actually use the create_cairo_surface vfunc on the
implementation drawable. D'oh.
2010-09-26 15:11:11 +02:00
Benjamin Otte
2c1633699f gdk: Rewrite background handling
Now the window background is a cairo_pattern_t. The backends will try to
set this as good as they can on the windowing system, but no guarantees
are made on wether the windowing system supports the pattern.

Also gets rid of GDK_NO_BG as undefined behavior is not a good idea to
support, and GDK_NO_BG effectively made the window's contents undefined.
It wasn't effectively used in GTK anyway.
2010-09-26 15:03:00 +02:00
Benjamin Otte
bfa6ad6e7c gdk: Remove _gdk_windowing_get_shape_for_mask()
It's unused. And there's a replacement available with
gdk_cairo_region_create_from_surface()
2010-09-26 15:02:59 +02:00
Benjamin Otte
6218c16ff8 API: Remove gdk_cursor_new_from_pixmap()
gdk_cursor_new_from_pixbuf() is the proper replacement.
2010-09-26 15:02:59 +02:00
Benjamin Otte
6ef27387e0 API: remove gdk_window_set_icon()
gdk_window_set_icon_list() now does everything gdk_window_set_icon()
used to do.
2010-09-26 15:02:59 +02:00
Javier Jardón
9c3d1080d6 Do not use deprecated gdk_display_get_core_pointer()
Use gdk_device_manager_get_client_pointer() instead
2010-09-22 03:42:15 +02:00
Havoc Pennington
b837ef5a6d Revamp and modernize X error traps
* add per-display gdk_x11_display_error_trap_push()
  (X11-specific because gdk_error_trap_push() probably
  should have been)
* make gdk_error_trap_push() handle only GDK displays
  not displays opened without a GDK wrapper
* make gdk_error_trap_pop() and gdk_x11_display_error_trap_pop()
  automatically sync only if needed, so manual gdk_flush() is not
  required
* add gdk_error_trap_pop_ignored() which just asynchronously
  ignores errors, so never needs to sync
* add G_GNUC_WARN_UNUSED_RESULT to plain pop(), because
  if you use plain pop() and don't need the return value,
  the async gdk_error_trap_pop_ignored() should be used
  instead. This results in lots of warnings to clean
  up in a later patch.

The main objective here was to avoid the need to sync just
to ignore an error. Now, syncing is automatic, and only
happens when we need to know the error code.

https://bugzilla.gnome.org/show_bug.cgi?id=629608
2010-09-18 18:19:27 -04:00
Tor Lillqvist
e748334327 Avoid potential DLL hijacking in Wintab code
Load Wintab32.dll from an absolute path. A proper Wintab32.dll, if
present, should be in the Windows system directory, so load it from
there.
2010-09-09 15:44:12 +03:00
Tor Lillqvist
ceca2ff10c Adapt to the GDK_KEY changes 2010-09-09 14:35:20 +03:00
Javier Jardón
bd277fad50 Remove deprecated gdk_window_get_deskrelative_origin() and its implementations 2010-09-09 00:50:46 +02:00
Tor Lillqvist
f42814168c Just use TrackMouseEvent directly
TrackMouseEvent is present in user32.dll in all Windows versions we
support. No need to look it up dynamically. No need to fallback to
_TrackMouseEvent from comctrl32.dll.
2010-09-03 00:30:56 +03:00
Tor Lillqvist
87bf99dcc5 Fix Win32 build 2010-08-29 12:40:56 +03:00
Matthias Clasen
eb10e6b128 Remove the long deprecated GDK_WINDOW_DIALOG type.
This has been deprecated forever, and was just left in for
compatibility reasons.
2010-08-28 20:10:02 -04:00
Tor Lillqvist
56f71f0123 Fix Win32 build
Builds now, except for the ms-windows theme engine. It doesn't really
work, though.
2010-08-23 18:55:54 +03:00
Kristian Rietveld
d819bc4814 Invalidate cairo surface if resizing is not supported for target
While X11 surfaces can be resized, this is not the case for Quartz
surfaces.  Instead of resizing we will invalidate the surface instead.
By giving _gdk_windowing_set_cairo_surface_size() a boolean return
value, we can signal back whether or not resizing was possible.  If not
possible, we invalidate the surface.
2010-08-10 21:02:31 +02:00
Benjamin Otte
c9d08d02e5 gdk: Remove data consructors for GdkPixmap
That is all of the gdk_pixmap/bitmap_create_from_* constructors.
2010-08-10 21:02:31 +02:00
Benjamin Otte
d0d2a6f12c API: remove gdk_colormap_query_color 2010-08-10 21:02:30 +02:00
Benjamin Otte
6a48a042c7 API: remove GdkGC
XXX: Some traces in the win32 code are left. I suppose they'd best be
replaced using Cairo.
2010-08-10 21:02:29 +02:00
Benjamin Otte
ef2d37cdaf API: remove begin/end_direct_draw functions
They're not needed without GdkGCs.

FIXME: This breaks the win32 XP theme. Someone gotta fix it.
2010-08-10 21:02:29 +02:00
Benjamin Otte
61d4a019f8 API: remove gdk_draw_drawable() 2010-08-10 21:02:29 +02:00
Benjamin Otte
65ac54bb23 gdk: Make window moves a custom vfunc
The window move code needs special attention for multiple reasons:
- invalid areas for expose events need to be modified
- self-copy is not supported by Cairo
- in X11, copying from an overlapped Window might cause unexposed areas
  to be copied in, spo expose events for those need to be generated.

This was all special cased in various parts of the code. By making it an
explicit vfunc, we can work around it.
2010-08-10 21:02:28 +02:00
Benjamin Otte
600fbd3e74 API: remove gdk_draw_rectangle() 2010-08-10 21:02:28 +02:00
Benjamin Otte
9ee5176492 API: remove gdk_draw_point(s) 2010-08-10 21:02:27 +02:00
Benjamin Otte
a9e99e7f5b API: remove gdk_draw_{line,lines,segments}
Those were the 3 intermixed line drawing calls.
2010-08-10 21:02:27 +02:00
Benjamin Otte
e85dfc7cc4 API: remove gdk_draw_polygon() 2010-08-10 21:02:27 +02:00
Benjamin Otte
559ae63f01 API: remove gdk_draw_arc() 2010-08-10 21:02:27 +02:00
Benjamin Otte
14fe04ec89 API: remove GdkImage
It was unused and buggy.
2010-08-10 21:02:26 +02:00
Benjamin Otte
6f5084551a API: remove gdk_drawable_copy_to_image() 2010-08-10 21:02:26 +02:00
Benjamin Otte
b926ce719b API: remove gdk_draw_image() 2010-08-10 21:02:26 +02:00
Benjamin Otte
4f8dbd4a8d API: Remove gdk_draw_pixbuf() 2010-08-10 21:02:25 +02:00
Javier Jardón
404e7d0e00 gdk/: fully remove gdkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:21:31 +02:00
Tor Lillqvist
34e8bd9dba Fix build breakage on Windows caused by the region changes
Patches by Sam Thursfield, from bug #623476.
2010-07-05 12:57:13 +03:00
William Jon McCann
0cfb94cdd4 [gdk] Add gdk_keymap_get_num_lock_state
https://bugzilla.gnome.org/show_bug.cgi?id=623239
2010-07-01 21:44:09 -04:00
Benjamin Otte
300e6b84cd s/GdkRegion/cairo_region_t/ in all of gtk
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Benjamin Otte
3e96cfe8fc Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Javier Jardón
06e48c50a1 Remove GDK_GC_FONT 2010-06-28 23:38:03 +02:00
Christian Dywan
655dcff096 Remove deprecated GdkFont
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604196

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-06-28 23:38:03 +02:00
Javier Jardón
c1affa4f3c Remove deprecated code from X interaction 2010-06-28 23:38:03 +02:00
Javier Jardón
c3987f9ee2 [GdkGC] Remove deprecated GdkFont from GdkGCValues structure 2010-06-28 23:38:03 +02:00