Commit Graph

198 Commits

Author SHA1 Message Date
Matthias Clasen
9846a37ee3 wayland: Drop an unused variable
The keymap member in GdkWaylandDisplay is not used at all,
so drop it.
2013-03-22 17:53:28 -04:00
Matthias Clasen
6c191b939d wayland: Fix key repeat
Key repeat under X is not affected by modifiers. And on some systems
(e.g my Thinkpad), NumLock is permanently on, rendering key repeat
nonfunctional. This commit changes the Wayland backend to do
key repeat regardless of modifiers.
http://bugzilla.gnome.org/show_bug.cgi?id=695497
2013-03-22 17:43:50 -04:00
Thomas Hindoe Paaboel Andersen
c5145421af wayland: complete cursor_for_pixbuf
Finishes the implementation for loading cursors from pixbufs.

Gnome bug #696223
2013-03-21 18:00:23 -04:00
Kristian Høgsberg
a80998127c wayland: Clear current cusor on leave so we always set it on enter
Commit 0d9d808217 fixed the hotspot issue,
but commit f2cc52fddd then optimized away
cursor changes a little too aggressively.  We always need to set the
cursor on enter.  Make sure we clear the current cursor on leave so we
don't think it's already set on the next enter.

https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-21 08:54:42 -04:00
Matthias Clasen
5f48934943 Wayland: Read settings out of GSettings directly
Until we figure out where we want to go with settings under
Wayland, this makes GTK+ applications a lot easier to deal
with under Wayland.

Note that we are careful to deal with the absence of schemas,
so this does not introduce a dependency on GNOME settings.
2013-03-21 07:15:59 -04:00
Kristian Høgsberg
f2cc52fddd wayland: Only set cursor when it changes 2013-03-20 22:59:06 -04:00
Kristian Høgsberg
62eb5d0358 wayland: Add a cursor cache
We avoid creating a new GdkCursor object every time
_gdk_wayland_display_get_cursor_for_name/type() is called.
2013-03-20 22:56:50 -04:00
Kristian Høgsberg
0d9d808217 wayland: Use the pointer enter serial when setting cursor surface
wl_pointer.set_cursor is rejected if the serial number doesn't match
the enter serial number for the wl_pointer.  We passed the right serial
number when setting the cursor surface in response to the enter event.
Later set_cursor requests fail, but we can still attach new buffers to
our cursor surface, which is why the cursor changed, but the hotspot
didn't update.  Clicking in the decoration results in a leave/enter pair
which triggers wl_pointer.set_cursor with the right serial. That's why
clicking the decoration sets the right cursor.

https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-20 22:56:43 -04:00
Matthias Clasen
26d3fc311b wayland: Keep hotspot when changing cursors
We need to pass the delta between the old and new hotspot
when attaching the new cursor surface, to keep the hotspot
at the same position. We can't deal with this in the compositor,
since the set_cursor call already overwrites the old hotspot,
so the information is lost by the time the attach happens.
Unfortunately, we can't query the initial hotspot from
the compositor, so the first cursor change will make the
hotspot jump.
https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-20 22:21:15 -04:00
Rob Bradford
1b15b9e1bc wayland: Preserve dimensions separately for fullscreen / maximised case
Use separate fields for saving the window dimensions prior to fullscreening
and maximisation. Then use those fields to restore the window dimensions from.
2013-03-19 19:52:49 +00:00
Scott Moreau
1be7f3dee9 wayland: Implement gdk_window_[un]maximize
This allows the buttons in the decorations to maximise the window.

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

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 15:51:39 +00:00
Scott Moreau
0d2c461720 wayland: Always attach buffer before committing
With recent changes in attach semantics, we always need to attach before
committing. Without this changes to the window contents to not get reflected
in the content of the surface.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
50cde3658a wayland: Remove unneeded semicolons
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
d8507a3a83 wayland: Remove unused wayland-egl header
This was left over from the work done in commit: d4a9863

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
89b1947631 wayland: Set title on shell surfaces to window title
We currently use this information to display the title
string in the window list of the desktop shell.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Matthias Clasen
5da58aa71d wayland: Rename GdkDeviceManagerCore to GdkWaylandDeviceManager
The 'core' naming is just an artifact of having several generations
of input extensions in X11, no need to propagate that into other
backends.
2013-03-15 09:19:35 -04:00
Thomas Wood
00a107cc4c wayland: don't attempt to unqueue events when events are paused
When events are paused, we should not return TRUE from prepare() or check().
GTK+ handles this for events that are already in the GTK+ queue, but
we also need suppress checks for events that are in the system queue - if we
return TRUE indicating that there are events in the system queue, then we'll
call dispatch(), and do nothing. The event source will spin, and will never
run the other phases of the paint clock.

https://bugzilla.gnome.org/show_bug.cgi?id=694274
2013-02-21 09:59:58 -05:00
Rob Bradford
2145907cfe wayland: Synthesize fullscreen window state change 2013-02-19 13:11:12 +00:00
Thomas Wood
fbc0572068 wayland: attempt to determine the possible parent surface for popups
Use the surface beneath the device that created the grab as the transient
parent for the popup surfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=693913
2013-02-18 19:38:21 -05:00
Thomas Wood
ec43a1f72a wayland: look further through the hierarchy for the surface with the grab
https://bugzilla.gnome.org/show_bug.cgi?id=693912
2013-02-18 19:38:21 -05:00
Owen W. Taylor
645b5f398d Reimplement _NET_WM_SYNC_REQUEST inside X11 backend
Deprecate gdk_window_enable_synchronized_configure() and
gdk_window_configure_done() and make them no-ops. Implement the
handling of _NET_WM_SYNC_REQUEST in terms of the frame cycle -
we know that all processing will be finished in the next frame
cycle after the ConfigureNotify is received.
2013-02-14 17:19:51 -05:00
Rob Bradford
4e1d999940 wayland: Add support for output device removal
Since we only receive an object id for the removed object we must try and
remove that from the list of devices based on that id.
2013-02-14 13:28:07 +00:00
Rob Bradford
fab808f92c wayland: Add basic multiple output support
Store the wl_output pointer within the the GdkWaylandMonitor structure.
2013-02-14 13:02:27 +00:00
Jan Arne Petersen
ff2a387154 wayland: Handle wl_output in GdkWaylandScreen
Expose information about outputs in GdkScreen (gdk_screen_get_n_monitors
and gdk_screen_get_monitor_*).
2013-02-13 15:52:05 +00:00
Thomas Wood
bfd7137ffb wayland: skip pointer and keyboard events without a surface
Pointer and keyboard events can be received after the surface has been
destroyed, in which case the surface will be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=693338
2013-02-12 15:30:56 +00:00
Thomas Wood
a8862727c9 wayland: set the "transient inactive" flag on tooltip surfaces
This prevents the tooltip surfaces from taking the focus away from the
parent surface.

https://bugzilla.gnome.org/show_bug.cgi?id=693313
2013-02-12 15:30:56 +00:00
Rob Bradford
f6383ebf9e wayland: React to G_IO_ERR and G_IO_HUP on the wayland socket
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=692728
2013-02-06 18:08:58 +00:00
Thomas Wood
2935b97b31 wayland: remove debug message
https://bugzilla.gnome.org/show_bug.cgi?id=693253
2013-02-06 16:56:44 +00:00
Thomas Wood
6657479c72 wayland: avoid returning NULL when getting a cursor
https://bugzilla.gnome.org/show_bug.cgi?id=693257
2013-02-06 16:56:44 +00:00
Thomas Wood
4f6d535626 wayland: use the GdkCursorType enum information to lookup the cursor name
Use the enum information to generate the cursor name rather than using a
lookup table.

https://bugzilla.gnome.org/show_bug.cgi?id=693256
2013-02-06 16:56:44 +00:00
Thomas Wood
69ac91b4b3 wayland: fix the direction of scrolling
Fix the direction of scrolling and convert the delta values into the
expected range.

https://bugzilla.gnome.org/show_bug.cgi?id=693251
2013-02-06 16:56:43 +00:00
Rob Bradford
b43d36d43d wayland: Use g_value_set_static to avoid string copies 2013-02-05 18:28:43 +00:00
Rob Bradford
93c3fec125 wayland: Pull the cursor theme name out from the setting for it
This avoids us using the default theme and allows us to use a wider range of
cursors.
2013-02-05 13:25:20 +00:00
Rob Bradford
69e9ecf90a wayland: Advertise the cursor theme through GtkSettings as Adwaita
... as per the way we advertise a GTK theme to use.
2013-02-05 13:25:20 +00:00
Jan Arne Petersen
e335a3fd31 wayland: Add global_remove handler
Do not crash on wl_registry.global_remove events anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=692899
2013-02-01 23:04:16 -05:00
Jan Arne Petersen
e437016a65 wayland: Make GdkWaylandDevice public
Rename GdkDeviceCore to GdkWaylandDevice and export it properly in a
header file. Add public accessors for wl_seat, wl_pointer and
wl_keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=692823
2013-02-01 23:03:17 -05:00
Jan Arne Petersen
363eea659c wayland: Rename GdkWaylandDevice
Rename GdkWaylandDevice to GdkWaylandDeviceData so that GdkDeviceCore
can be renamed to GdkWaylandDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=692823
2013-02-01 23:03:15 -05:00
Jan Arne Petersen
ac3a50bfe6 wayland: Remove unused, commented out code
https://bugzilla.gnome.org/show_bug.cgi?id=692823
2013-02-01 23:03:12 -05:00
Rob Bradford
a687cbaae8 wayland: Implement gdk_window_fullscreen & gdk_window_unfullscreen 2013-01-29 18:42:44 +00:00
Rico Tzschichholz
22bad6a240 wayland: Add missing reference to gdkwaylandwindow.h
Missing bit of 01c0dd9182
2013-01-27 16:32:44 +01:00
Jan Arne Petersen
01c0dd9182 wayland: Make GdkWaylandWindow public
Allows to access Wayland specific window information like wl_surface and
wl_shell_surface.

Add gdk_wayland_window_get_wl_surface for getting the Wayland wl_surface
and gdk_wayland_window_get_wl_shell_surface for getting the Wayland
wl_shell_surface.
2013-01-23 22:26:27 +01:00
Jan Arne Petersen
2b9f0b4817 wayland: Make GdkWaylandDisplay public
Allows to access Wayland specific display information like wl_display
etc.

Add gdk_wayland_display_get_wl_display for getting the Wayland
wl_display.
2013-01-23 22:26:27 +01:00
Rob Bradford
2d676f32b1 wayland: Handle the keymap being needed before we know about seats
In the Wayland backend implementation for gdk_display_get_keymap we enumerate
the known devices and look for an core keyboard device. These device objects
are created when we receive the capabilities for the seat. The seat
capabilities may be received after a request for the keymap so we handle this
by creating a temporary keymap which we then free later when we have the real
one.
2013-01-22 19:12:29 +00:00
Rob Bradford
d4a9863e19 wayland: Drop code to use cairo-gl for rendering
The APIs that this code relied upon were removed in Wayland 1.0 and as such
this code has been broken since then.
2013-01-18 08:56:47 +00:00
Ran Benita
21cf5a7e00 wayland: update to work with stable libxkbcommon
libxkbcommon has had some changes to its API. However, it now has a
stable release (0.2.0), so this makes the necessary changes, and
replaces all uses of the deprecated API.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-29 15:45:31 +00:00
Scott Moreau
e5b88f1bdd wayland: Update to reflect protocol changes 2012-10-19 12:21:35 +01: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