Commit Graph

4847 Commits

Author SHA1 Message Date
Alexander Larsson
29a42085c6 Remove gdk_window_flush_if_exposing as its not needed anymore
We no longer support modifying GdkWindow hierarchies during
expose events. This is not working anymore anyway as the
flush operation now does not push already rendered pixels
in the flushed window from the double buffer to the window.

https://bugzilla.gnome.org/show_bug.cgi?id=679144
2012-08-23 16:31:31 +02:00
Alexander Larsson
e112cdacd4 Fix flashing in non-double-buffered widgets
Avoid copying back partially drawn double-buffer data
when flushing to avoid flicker. This means non double
buffered widgets must draw opaque pixels in its expose
handlers, and that you are not allowed to use direct
rendering (or modify GdkWindow pos/size/order) from
inside the expose handler of a double buffered widget.

See https://bugzilla.gnome.org/show_bug.cgi?id=679144 for more
details
2012-08-23 16:31:30 +02:00
Alexander Larsson
820b0cafe0 gdkwindow.c: Fix up window debug code
Make this build and fully print clip regions.
2012-08-23 12:16:43 +02:00
Alexander Larsson
04811d9483 Avoid unnecessary window flushes
The code was calling _gdk_window_ref_cairo_surface in a few places
where the intent was not to read/write to the surface, but just look
at its type (to e.g. create a similar surface). This is bad, as that
operation causes a flush which may cause unnecessary work and/or
flashing. Instead we just get the impl surface in these cases.
2012-08-23 12:16:43 +02:00
Michael Natterer
78506bd604 quartz: add evil casting to make sure time wraps correctly on 32bit machines
get_time_from_ns_event(): apply patch from Michael Hutchinson which
makes sure the returned guint32 wraps correctly on 32 bit machines
when the uptime exceeds 2^32 ms.
2012-08-23 09:31:12 +02:00
John Ralls
2cb739a2d5 Implement gdk_quartz_keymap_lookup_key 2012-08-22 14:39:11 -07:00
Matthias Clasen
6fe0fbd4e2 Leave GDK_THREADS_ENTER/LEAVE visible for now
Not defining these macros at all causes harsh build breakages.
Better to leave them defined (but documented as deprecated) for now.
Everybody will still get the deprecation warnings for the underlying
gdk_threads_enter/leave.

We can hide the macros again later on when the world has had some
time to port off GDK threads.
2012-08-06 08:34:46 -04:00
Matthias Clasen
8f55b2775a Expand the thread deprecation documentation
The story is slightly different for applications vs libraries;
make it clear that libraries should continue using the lock so
we don't break applications that haven't been ported to the
'single thread' model yet.
2012-08-01 10:26:17 +02:00
Matthias Clasen
b936666b52 Improve threading documentation
This commit just adds a small section to the threading documentation
about the deprecation. More is needed here, including a migration
example.
2012-07-30 18:01:47 +02:00
Matthias Clasen
0ac56e9dcc gdk: Deprecate thread functions
This commit deprecates gdk_threads_init, gdk_threads_enter,
gdk_threads_leave and gdk_threads_set_lock_functions. Using GTK+
from multiple threads does not work at all on Windows, and is
problematic on other platforms as well. We want to move to a world
where all GTK+ calls are made from the main thread.
Use g_main_context_invoke, g_idle_add and related functions if you
need to schedule GTK+ calls from other threads.

http://bugzilla.gnome.org/show_bug.cgi?id=680754
2012-07-30 18:01:47 +02:00
Matthias Clasen
144a5687c9 gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step.
2012-07-30 18:01:47 +02:00
Rob Bradford
7c51d67e7c wayland: Fallback to setting transient windows if no seat available
If we don't have a wl_seat - because a grab hasn't been initialised by GTK+
then fallback to making the shell surface transient to the parent rather than
a popup surface.
2012-07-18 16:16:56 +01:00
Rob Bradford
8a39d2269e wayland: Don't compare against GdkWindowTypeHint as a bitmask
The hint was being compared as a bitmask which means types that were not in
the list were being erroneously matched
2012-07-18 16:08:36 +01:00
José Dapena Paz
c5ef4e660b wayland: Add default settings implementation for Wayland backend.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-17 11:31:54 +01:00
José Dapena Paz
33e928e472 wayland: Initial version of keyboard key event handling
Review comment: I think the implementation of the vfuncs in gdkkeys-wayland.c
depend on that we're using the keysysm as the hardware keycode. I think that
needs to be evaluated for the future. But for now this patch gives reasonably
complete keyboard input.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
José Dapena Paz
d2c66e5afd wayland: Hook up _get_num_lock / _get_caps_lock to read from XKB state
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
Rob Bradford
bef037f5d2 wayland: Remove unused function declaration 2012-07-16 20:11:41 +01:00
Rob Bradford
b5773b89cf wayland: Remove annoying whitespace 2012-07-16 20:11:41 +01:00
José Dapena Paz
a4c80bd9cb wayland: Create and expose an xkb_state on the keymap object
This is then logically associated with the input device since each (keyboard)
input device has its own keymap.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
José Dapena Paz
d2267824b3 wayland: Refactor the keymap handling so it is associated with device
Although GDK expects the keymap to be associated with the display under
Wayland this is really associated with the input device so expose this by
finding the first keyboard device.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
Rob Bradford
21f4b1cb35 wayland: Use the correct union member for axis events
Otherwise we end up overriding other members of the struct (in this case the
device pointer) and generate an error.
2012-07-16 15:38:09 +01:00
José Dapena Paz
a93f246056 wayland: implementation of pointer_handle_axis.
We translate wayland pointer axis events to GDK smooth scroll events, to
implement pointer_handle_axis events.

https://bugzilla.gnome.org/show_bug.cgi?id=679986
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 15:37:53 +01:00
Rob Bradford
d8d4eb3faa wayland: Implement the keyboard_enter/keyboard_leave events
This code is derived from the old keyboard focus change event handling.
2012-07-16 13:44:29 +01:00
Rob Bradford
3f0f328fd1 wayland: data_device.data_offer now has a safe object wrapper
The prototype for the listener has changed to provide a typesafe object rather
than an id that you have to bind into an object yourself.
2012-07-16 13:44:29 +01:00
Rob Bradford
1d080a01c1 wayland: Process the keymap that is sent over from the compositor
Load the keymap from the file descriptor that the compositor has sent us and
then save that into our internal object for future use.
2012-07-16 13:44:29 +01:00
Rob Bradford
19d16f8b80 wayland: Expose _gdk_wayland_display_get_keymap internally 2012-07-16 13:44:29 +01:00
Rob Bradford
91a11ee277 wayland: Ensure we destroy the shell surface when destroying the surface
Otherwise we can try and use an invalid object that the compositor has already
deleted.
2012-07-12 15:58:38 +01:00
Rob Bradford
8bd1478596 wayland: wl_shell_surface_set_popup requires a valid seat and serial
If we don't have our own grab then get the grab from the parent.
2012-07-12 15:58:38 +01:00
Rob Bradford
5b81186be3 wayland: Protocol update: wl_pointer_set_cursor takes a serial 2012-07-12 15:58:38 +01:00
Rob Bradford
310fd40357 wayland: Protocol update: wl_shell_surface_resize and _move take serials 2012-07-12 15:58:38 +01:00
Rob Bradford
9f039e5b74 wayland: Save the serial number for the ping event 2012-07-12 15:58:38 +01:00
Rob Bradford
a4f032f1ea wayland: Save the serial numbers for the pointer events 2012-07-12 15:58:38 +01:00
Rob Bradford
7fe87016f3 wayland: Add internal API for handling Wayland serial numbers
We need to keep track of the serial numbers for various API requests.
2012-07-12 15:58:38 +01:00
Rob Bradford
17d1c3c833 wayland: Ensure that _get_client_pointer returns a pointer
The previous implementation could return a device that is a keyboard.
2012-07-12 15:58:38 +01:00
Rob Bradford
77791f0708 wayland: Port to libxkbcommon API changes
xkb_string_to_keysym -> xkb_keysym_from_name
xkb_keysym_get_name -> xkb_keysym_get_name
2012-07-12 15:58:38 +01:00
Rob Bradford
93a338245a wayland: Switch to new wayland cursors mechanism 2012-07-12 15:58:38 +01:00
Rob Bradford
33b9f8e1b8 wayland: Protocol change: wl_buffer_damage
wl_buffer_damage is no longer necessary - it is sufficient to damage the
surface that the buffer is attached to instead.
2012-07-12 15:58:38 +01:00
Rob Bradford
6cdb75256e wayland: Protocol change: configure event
The 'time' value has been removed.
2012-07-12 15:58:38 +01:00
Rob Bradford
0d1ae2e0dd wayland: Protocol change: wl_shell_surface_* take surfaces for parents
These functions used to take shell_surface objects and now take surface
objects the parents.
2012-07-12 15:58:38 +01:00
Rob Bradford
8d7869ecbb wayland: Remove unused variable 2012-07-12 15:58:38 +01:00
Rob Bradford
598c1b27fe wayland: Temporary disable/hackaround keyboard code 2012-07-12 15:58:38 +01:00
Rob Bradford
f20ac38315 wayland: Port to SHM pool allocation mechanism 2012-07-12 15:58:38 +01:00
Rob Bradford
3eb0b195ed wayland: Port to new input protocol mechanism
This replaces the wl_input_device with wl_pointer, wl_keyboard, wl_touch all
tied together under a wl_seat.

This is quite a radical change in protocol and for now keyboard handling is
disabled.
2012-07-12 15:58:38 +01:00
Rob Bradford
b1a5b19b4a wayland: Load cursor theme using new Wayland cursor library
This requires the SHM object be initialised - therefore this is the most
logical (if slightly ugly place.)

We also need to make sure that we do something clever to load the correct
cursor theme.
2012-07-12 15:58:38 +01:00
Rob Bradford
2928ffc7b1 wayland: Remove unhelpful debug message 2012-07-12 15:58:37 +01:00
Rob Bradford
936ceb84b5 wayland: Protocol change: ping event on shell_surface 2012-07-12 15:58:37 +01:00
Rob Bradford
a9dc48ce94 wayland: Update to new header path for xkbcommon 2012-07-12 15:58:37 +01:00
Phil Clayton
bd3e3974c9 Change signal parameter names in GdkWindow to be valid C identifiers
https://bugzilla.gnome.org/show_bug.cgi?id=679228
2012-07-11 07:24:47 -04:00
Chun-wei Fan
fd6ce9975e Bug 676077: Fix handling of Keyboard Input on Windows
Don't use ASCII control characters to denote the input of Esc, Tab,
Return/Enter, Backspace and Delete, as it seems that it is not how
Windows handle them, and they cause weird characters to appear in the
input field on GTK+3 programs in non-English Windows.  Instead, let
these keys be handled as-is on Windows, like what is done in GTK+-2.x.

Checked with mclasen on IRC, and thanks to the people who verified the
patch to not break anything on English Windows.
2012-06-25 23:23:01 +08:00
Matthias Clasen
116b5e560f GdkDevice: Fix an inverted assertion
gdk_device_list_slave_devices only makes sense to call on master
devices, yet its g_return_if_fail check made it reject such devices.

Pointed out by monty.
2012-06-20 22:44:32 -04:00