Commit Graph

554 Commits

Author SHA1 Message Date
Jasper St. Pierre
8061df1544 gdkwindow-wayland: Obey Wayland buffer semantics
We can't destroy buffers if they're in-use by the compositor. Well,
technically we can, but that is considered undefined by Wayland and
mutter won't cope with it very well -- it simply kills the client.

To solve this, we need to delay the destroy operation until the
compositor tells us that it's released the buffer. To do this, hold
an extra ref on the cairo surface as long as the surface is in-use
by the compositor.
2014-02-03 19:08:45 -05:00
Jasper St. Pierre
c08b315c32 gdkwindow-wayland: Erm, put the DESTROYED check in the right spot... 2014-01-31 16:43:49 -05:00
Jasper St. Pierre
98d1b5464d gdkwindow-wayland: Bail out early if we get a frame callback when destroying our window
This prevents warnings like

(gtk3-demo:14948): Gdk-CRITICAL **: _gdk_frame_clock_thaw: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed

(gtk3-demo:14948): Gdk-CRITICAL **: gdk_frame_clock_get_timings: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed

We need to do this, as the compositor might have already sent us a frame
event, in-flight, at the same time we destroy our window. In this case, we'll
receive the then-in-flight "done" event, and then warn as we try to look
up the frame clock on a destroyed window.
2014-01-31 16:25:27 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
31532ca42f docs: fix typo in signal link 2014-01-21 18:57:41 -05:00
William Jon McCann
83e8e38bd2 wayland: fix rename of wl_shell to xdg_shell
Regression from 9127087e1c
2014-01-20 14:37:33 -05:00
Matthias Clasen
af87a7e7c8 Fix make dist 2013-12-17 07:31:41 -05:00
Jasper St. Pierre
e582404e90 wayland: Fix order of xdg-shell requests 2013-12-11 19:28:30 -05:00
Jasper St. Pierre
fe584b9f00 wayland: Update to latest xdg-shell.xml 2013-12-07 13:25:38 -05:00
Jasper St. Pierre
4844ef88db wayland: Make sure to call use_unstable_version 2013-12-07 13:25:38 -05:00
Matthias Clasen
8fbda8efce Don't distribute generated sources
This was causing problems when building 3.10.6 against an older
wayland.
2013-12-05 09:07:19 -05:00
Jasper St. Pierre
aa02b5b909 wayland: Sync transient-for on xdg-surface show as well... 2013-11-21 13:04:00 -05:00
Jasper St. Pierre
9232089b35 wayland: Allow set_title after initial showing
and fix the ordering of title / app_id
2013-11-21 13:04:00 -05:00
Jasper St. Pierre
750419e8d9 Update xdg-shell.xml 2013-11-21 13:03:59 -05:00
Jasper St. Pierre
03ad459c5b Update xdg-shell.xml 2013-11-19 18:59:50 -05:00
Jasper St. Pierre
937dd010d0 wayland: Don't assert fail in DND
This needs completion, sure thing, but let's try to just not fall
flat on our face first.
2013-11-19 18:55:26 -05:00
Jasper St. Pierre
96ca7fe6e6 wayland: Don't recreate the gtk_surface on every show
It's illegal.
2013-11-19 18:40:58 -05:00
Jasper St. Pierre
6f9b2ac805 wayland: Set DBus properties after we've constructed the xdg_surface 2013-11-19 16:37:25 -05:00
Jasper St. Pierre
7e3e50729f wayland: Fix invalid cast in transient_for 2013-11-19 12:36:27 -05:00
Jasper St. Pierre
9127087e1c wayland: Replace wl_shell_surface with xdg_shell 2013-11-18 13:44:20 -05:00
Ryan Lortie
a90bb7de0e Add a GtkSetting for 'shell-shows-desktop'
Add a GtkSetting for whether the desktop shell is showing the desktop
folder icons.

This is on by default because most desktop shells do show the icons on
the desktop.  We already have a patch in gnome-settings-daemon to bind
this to the org.gnome.desktop.background show-desktop-icons GSettings
key which is off by default on GNOME.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-14 15:03:04 -05:00
Owen W. Taylor
f50a3af1b7 Handle recursion from motion event handlers
If a motion event handler (or other handler running from the flush-events
phase of the frame clock) recursed the main loop then flushing wouldn't
complete until after the recursed main loop returned, and various aspects
of the state would get out of sync.

To fix this, change flushing of the event queue to simply mark events as
ready to flush, and let normal event delivery handle the rest.

https://bugzilla.gnome.org/show_bug.cgi?id=705176
2013-11-11 23:17:14 -05:00
Jasper St. Pierre
ad59827ec8 Revert "wayland: Support always-on-top / sticky windows"
This reverts commit b3cffb85f3.

Pushed by accident.
2013-10-29 17:13:03 -04:00
Jasper St. Pierre
b3cffb85f3 wayland: Support always-on-top / sticky windows
Use the new gtk-shell APIs available in mutter to add support for this.

https://bugzilla.gnome.org/show_bug.cgi?id=710056
2013-10-28 18:03:26 -04:00
Jasper St. Pierre
1ace4b886d wayland: Always attach null surfaces on hide
Destroying the surface isn't really appropriate, as the GtkWindow
is still realized and we won't necessarily know how to reconstruct it.
2013-10-28 18:03:26 -04:00
Jasper St. Pierre
301d4ee681 wayland: Remove a useless else-if
We already check for impl->surface as the first branch we do.
2013-10-28 18:03:26 -04:00
Jasper St. Pierre
224822c831 wayland: Make the code here a bit clearer
By grouping the destroy and field clear together.
2013-10-28 18:03:26 -04:00
Jasper St. Pierre
84e3aa016f wayland: Ensure we keep our internal state when hiding a window with no surface
We need to keep track of the mapped variable here.
2013-10-28 18:03:26 -04:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Matthias Clasen
0db75c6b10 Wayland: avoid accidental export of internal symbols
Some symbols in the generated Wayland code were getting
decorated with WL_EXPORT, causing them to show up in the
libgdk exports. We don't want that.

https://bugzilla.gnome.org/show_bug.cgi?id=710141
2013-10-15 19:44:49 -04:00
Matthias Clasen
73bae5b816 Wayland: fix a crash in opaque region handling
We may get a NULL region passed to the backend, which means
'nothing is opaque'. In that case, don't crash, but pass
the information on to the compositor.

http://bugzilla.gnome.org/show_bug.cgi?id=709854
2013-10-15 18:21:44 -04:00
Matthias Clasen
4b13b93394 Improve struct packing in GdkWindowImplWayland 2013-09-21 23:50:55 -04:00
Matthias Clasen
41f8ad5384 Document some Wayland apis 2013-09-17 01:16:13 -04:00
Matthias Clasen
5d33a7cb18 Trivial formatting fixes 2013-09-17 01:13:31 -04:00
Matthias Clasen
11ad337a29 Avoid a segfault when menus are re-shown under Wayland
The surface is destroyed when we hide a window, but
gdk_window_set_opaque_region can be called before the window is
shown again, so we need to ensure the surface exits.

https://bugzilla.gnome.org/show_bug.cgi?id=707328
2013-09-16 19:01:48 -04:00
Matthias Clasen
67f05b995f Trivial formatting fixes 2013-09-16 18:15:57 -04:00
Rico Tzschichholz
13e843b7d7 wayland: Fix make dist
In addition to d34335e51c
2013-09-11 17:20:55 +02:00
Colin Walters
0697cbb88c build: Fix srcdir != builddir with wayland-client-protocol.h
In the gnome-ostree model builddir contains all generated files not in
git (unless the build system explicitly overrides that).  Here the
wayland-client-protocol.h was in $(builddir)/wayland, so we need to
find it using our already extant -I$(top_builddir)/gdk, rather than
relying on same-directory lookup.
2013-09-03 17:52:38 -04:00
Giovanni Campagna
3c5d9d6889 wayland: set the wm_class on toplevel windows
Before mapping the window, set the title and class, to allow
application tracking by gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Giovanni Campagna
7f8bf41633 gtk-shell: extend the protocol with shell capabilities
Add the concept of shell capabilities, which allow the compositor
to advertise support for the app menu and the global menubar,
which are then propagated as GdkSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Giovanni Campagna
ed9f55d521 wayland: restore support for the application menu
If the compositor supports the gtk-shell interface, use it to
export the application ID, dbus name and paths that can be used
for the application menu.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Giovanni Campagna
d34335e51c wayland: add support for a private gtk-shell protocol
This protocol will be used by mutter-wayland and gtk to replace
the _GTK X11 properties for DBus names/paths.

https://bugzilla.gnome.org/show_bug.cgi?id=707129
2013-09-03 17:03:43 +02:00
Pavel Vasin
832e77fbb4 GdkWaylandWindow: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=706493
2013-08-31 12:28:20 -04:00
Christian Hergert
5add9625e2 wayland: fix crash in gdk_window_wayland_get_root_coords().
Both root_x and root_y may be NULL, so check first before setting.
2013-08-30 00:39:18 -07:00
Emilio Pozuelo Monfort
7761e99558 wayland: trust the compositor to always send a good serial number
https://bugzilla.gnome.org/show_bug.cgi?id=706870

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-08-28 18:18:39 +01:00
Jasper St. Pierre
08fbba4558 gdk: Add opaque region setters
https://bugzilla.gnome.org/show_bug.cgi?id=706922
2013-08-28 10:33:57 -04:00
Kristian Høgsberg
771dbe0592 wayland: Compare serial numbers correctly to avoid overflow problems
We have to look at the difference between two numbers, which will always
be well-defined and give the right result, even in case of integer overflow.
2013-08-23 23:15:53 -07:00
Kristian Høgsberg
384a4e6ddb wayland: Use current serial when setting selection, not _wl_time_now()
The wl_data_device.set_selection request expects a serial number.
2013-08-23 23:15:53 -07:00
Kristian Høgsberg
56ac58c584 wayland: wl_data_device.enter provides a serial number, not a timestamp 2013-08-23 23:15:53 -07:00
Matthias Clasen
f8412eca34 Revert "Deprecate and ignore the cursor blink settings"
This reverts commit b2e666bf8f.

We need to keep cursor blinking configurable for accessibility
reasons.

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

Conflicts:
	gdk/win32/gdkproperty-win32.c
	gdk/x11/gdksettings.c
	gtk/gtksettings.c
	gtk/gtktextview.c
2013-08-16 22:45:13 -04:00
Matthias Clasen
87257342de Fix a crash with scaled cursors on Wayland
We need to initialize cursor->surface.scale to 1, since we
are dividing by it in _gdk_wayland_cursor_get_buffer.
2013-08-11 15:38:25 -04:00
Alexander Larsson
b2113b7384 gdk: Add gdk_cursor_new_from_surface
We need this to be able to handle scaled cursor images.
We implement the new _from_pixbuf by converting to a surface and
assuming the scale was 1.
2013-08-07 13:34:10 +02:00
Alexander Larsson
71fe43543c gdk: Add gdk_cursor_get_surface()
We want a surface so we can properly represent the scale factor for it.
All backends are converted to use surfaces and we reimplement the
backwards compat code in the generic code.
2013-08-07 13:34:10 +02:00
Rob Bradford
a4d9e92f66 wayland: Dispatch pending events before entering poll
If we don't dispatch the pending events then we can enter poll with events
still requiring to be processed and which can then lead to us deadlocking
there.
2013-08-04 14:42:14 +01:00
Rob Bradford
a8fc099a72 wayland: Only try and process keyboard events when focussed
When combining Clutter with GTK+ we can receive events for surfaces which in
the client side we do not have focussed.
2013-08-04 14:42:14 +01:00
Rob Bradford
3625f17857 wayland: Only try and process pointer events when focussed
When combining Clutter with GTK+ we can receive events for surfaces which in
the client side we do not have focussed.
2013-08-04 14:42:14 +01:00
Rob Bradford
e8e6ae8189 wayland: Only process the event if it's for a GdkWindow
When we combine GTK with Clutter we will receive events for both surfaces that
we have created as well as those created by Clutter.
2013-08-04 14:42:14 +01:00
Matthias Clasen
0d999c626f Wayland: Add a missing break statement
Found by the clang static analyzer.
2013-08-04 01:27:39 +02:00
Rob Bradford
16e43733b9 wayland: Create a cairo surface for the root window
Many parts of GTK+ assume that all windows have a cairo surface
assoicated with them. This change provides a logically 1x1 cairo surface
(respecting scale) for the root window.

https://bugzilla.gnome.org/show_bug.cgi?id=704554
2013-07-24 18:30:19 +01:00
Giovanni Campagna
047d60e797 gdk/wayland: cope with the compositor implementing an older protocol than us
If we bind to a global with an higher version than implemented, or
we make requests that appeared in a later version, we would get
fatal wayland errors.

https://bugzilla.gnome.org/show_bug.cgi?id=704104
2013-07-16 18:19:08 +02:00
Rob Bradford
af26a18032 wayland: Handle the display connection erroring out
wl_display_flush or wl_display_dispatch can return -1 if there is an
error on the display connection.

https://bugzilla.gnome.org/show_bug.cgi?id=703892
2013-07-09 18:52:56 -04:00
Kristian Høgsberg
99b78fdd7f wayland: Don't clear revents until we've checked for G_IO_HUP
https://bugzilla.gnome.org/show_bug.cgi?id=703892
2013-07-09 18:38:32 -04:00
Rob Bradford
0dbd9dc0a7 wayland: request appropriate compositor version to support buffer scale
With the introduction of the use of buffer scaling in ed4fcee4ct we
must request version 3 of the compositor as that is the version of the
surface interface that adds this new functionality. See the following
commit in weston:

commit a85118c1b85df6fbf8f896dca971a5b79a94da71
Author: Jason Ekstrand <jason@jlekstrand.net>
Date:   Thu Jun 27 20:17:02 2013 -0500

    Use wl_resource_create() for creating resources

    This commit sets the version numbers for all added/created objects.  The
    wl_compositor.create_surface implementation was altered to create a surface
    with the same version as the underlying wl_compositor.  Since no other
    "child interfaces" have version greater than 1, they were all hard-coded to
    version 1.

    Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>

https://bugzilla.gnome.org/show_bug.cgi?id=703817
2013-07-09 10:11:58 +01:00
Jürg Billeter
7f9f3aad5a wayland: Fix build due to missing symbol export
https://bugzilla.gnome.org/show_bug.cgi?id=703765
2013-07-09 07:09:13 +02:00
William Jon McCann
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
Rob Bradford
d2ba7d75c3 wayland: Create the Wayland surface for the window on impl creation
Ths allows the retrieval of the wl_surface before the window is shown.
The surface is still created in the original places since the surface
and shell surface is destroyed when the surface is programmatically
hidden.
2013-07-03 16:26:00 +01:00
Michael Forney
ce9f232eb8 wayland: Fix typo in setting of core_pointer
This typo caused the display's core_pointer to be set only if the mouse
was first in the device list.

https://bugzilla.gnome.org/show_bug.cgi?id=703434
2013-07-03 15:24:50 +01:00
Alexander Larsson
83c5e354bd wayland: Add custom create_similar_image implementation
The fallback method is used on other backends, but it caused
problems for wayland when it tried to create a surface for
the root window.
2013-07-03 16:03:25 +02:00
Alexander Larsson
e8b38fedbd gdk: Convert mouse position to doubles, add new getters
We've long had double precision mouse coordinates on wayland (e.g.
when rotating a window) but with the new scaling we even have it on
X (and, its also in Xinput2), so convert all the internal mouse/device
position getters to use doubles and add new accessors for the
public APIs that take doubles instead of ints.
2013-07-03 14:39:25 +02:00
Alexander Larsson
ed4fcee4c6 wayland: Support gdk_window_get_scale
We track the list of outputs each window is on, and set the
scale to the largest scale value of the outputs. Any time the scale
changes we also emit a configure event.
2013-07-03 14:34:13 +02:00
Alexander Larsson
ce68a2f870 wayland: Implement gdk_screen_get_monitor_scale()
We bind to the newer version of the wl_output which supports
the new done and scale events, and if we use this to get the
scale for each monitor (defaulting to 1 if not supported).
2013-07-03 14:34:13 +02:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
e8147d15f7 Deprecate and ignore gtk-menu-images setting
GtkImageMenuItem images can still be enabled selectively by the app author
using the always-show-image property on the item.
2013-06-26 10:53:09 -04:00
Rob Bradford
bfe87c44a8 wayland: Add missing symbol export
gdk_wayland_window_set_use_custom_surface was not being exported
correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=695861
2013-06-26 15:09:51 +01:00
William Jon McCann
65c31629c3 Deprecate and ignore gtk-button-images setting
Button images can still be enabled selectively by the app author
using the always-use-image property on the button.
2013-06-26 09:15:22 -04:00
William Jon McCann
1b3f9df361 Remove rest of gtk-show-input-method-menu and gtk-show-unicode-menu
They are no longer used.
2013-06-21 08:59:32 -04:00
Matthias Clasen
875b1d07de Don't include X11 headers in wayland
The include of X11/keysyms.h in gdkdevice-wayland.c was just
a leftover.
2013-05-23 12:26:26 -04:00
Matthias Clasen
3beeb2cda0 Wayland: not all screens are square
https://bugzilla.gnome.org/show_bug.cgi?id=700737
2013-05-21 07:50:22 -04:00
Thomas Wood
9cb197abc2 wayland: ensure the clip region is updated after the window size is updated
https://bugzilla.gnome.org/show_bug.cgi?id=700301
2013-05-14 16:33:25 +01:00
Alexander Larsson
590366f0e7 wayland: Don't use double buffers for wayland when not needed
If we got the release event for the last buffer then we're
fine with writing directly to the window surface, as wayland
will not be looing at it. This saves us from allocating
and copying more data.
2013-05-07 16:33:01 +02:00
Alexander Larsson
19560bf0d4 gdkwindow: Remove translate vfunc
This is not used anymore
2013-05-07 16:33:00 +02:00
Matthias Clasen
8af16c5d44 New visibility handling in gdk
Change the visibility handling to be the same way we do it in
GLib now. We pass -fvisibility=hidden to gcc and decorate public
functions with __attribute__((visibility("default"))).

This commit just does this for GDK, GTK+ will follow later.
2013-05-05 15:38:48 -04:00
Matthias Clasen
ca81028901 Add GDK_AVAILABLE_IN_ALL annotations in gdk
This is in preparation to modernizing our handing
of exported symbols.
2013-05-05 15:38:46 -04:00
Matthias Clasen
e61df371c9 Prevent criticals when initializing a Wayland display
When we call _gdk_wayland_display_load_cursor_theme during
the initial opening of the first display, gdk_setting_get does
not work yet, since it relies on the default display/screen
being set, which only happens after open returns.
Instead, just use the screen of this display.
2013-05-04 16:13:09 -04:00
Benjamin Otte
7470a280da wayland: Remove displaymanager implementation
This is an API break, but the wayland backend is unsupported, so we can
get away with it.
2013-05-02 16:14:59 +02:00
Benjamin Otte
a30b84f522 wayland: Don't add/remove displays manually
This code is handled by GdkDisplay itself these days.
2013-05-01 18:12:38 +02:00
Owen W. Taylor
b72cf9129c wayland: when possible, fill in actual and predicted presentation times
There is currently no Wayland protocol for providing presentation
timestamps or hints about when drawing will be presented onscreen.
However, by assuming the straightforward algorithm used by the
DRM backend to Weston, we can reverse engineer the right values.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:55:03 -04:00
Owen W. Taylor
23031defde wayland: fill in refresh_interval in GdkFrameTimings
Track the outputs that a window is on, and use the refresh rate from
a random one of those outputs for the refresh_interval in
GdkFrameTimings.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:50:01 -04:00
Owen W. Taylor
f1ce727b06 GdkWaylandWindow: Consolidate surface creation and destruction code
Combine duplicate code for creating and destroying surfaces.
To make the operation of the destroy() operation more obvious, the
destruction of the (fake) root window at display dispose time is
changed to not be a "foreign" destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:49:47 -04:00
Owen W. Taylor
ca120a98e5 GdkWaylandWindow: synchronize frame drawing
Use wl_surface_frame() to get notification when the compositor paints
a frame, and use this to throttle drawing to the compositor's refresh
cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:21 -04:00
Owen W. Taylor
c71fea568f GdkWindowWayland: make sure we attach the surface when repainting
Lazily creating the cairo surface that backs a window when we
first paint to it means that the call to
gdk_wayland_window_attach_image() in
gdk_wayland_window_process_updates_recurse() wasn't working the
first time a window was painted.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:12 -04:00
Owen W. Taylor
d5310f9367 GdkWindowWayland: draw, then damage, then commit
When exposing an area, we were individually damaging and committing
each rectangle, *before* drawing. Surprisingly, this almost worked.
Order things right and only commit once.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:06 -04:00
Benjamin Otte
a6a4428f23 gdk: Unvfuncify gdk_display_manager_open_display()
This looks like a pretty stupid patch, but it's only a step towards the
ultimate end goal: Get rid of all the displaymanagers.
2013-04-19 16:23:43 -04:00
Benjamin Otte
edfaeba32b Revert "wayland: Cache the discovery connection and reuse if possible"
This reverts commit 524ce7f88e.
2013-04-19 16:22:32 -04:00
Benjamin Otte
cadfa58801 wayland: Get rid of generic macros
They're unused.
2013-04-19 16:18:25 -04:00
Benjamin Otte
f345051d36 displaymanager: Emit display-opened directly
Instead of letting every backend do it manually.
2013-04-19 16:18:25 -04:00
Rob Bradford
524ce7f88e wayland: Cache the discovery connection and reuse if possible
This will prevent us opening, closing and reopening the same display
connection in the majority of cases.

https://bugzilla.gnome.org/show_bug.cgi?id=694465
2013-04-19 14:03:24 +01:00
Benjamin Otte
0990c11a83 gdk: Unvfuncify generic key functions
This makes Wayland and X11 no longer call into XKB and libX11 for these
functions but use GDK's own copy of these functions, just like the
win32, quartz and broadway backends.
2013-04-16 15:30:14 +02:00
Benjamin Otte
aa9e974c86 gdk: Make atoms handled generically
This is another step towards making GdkDisplayManager backend-agnostic.

Most of the backends profit from this as their atom implementations
where generic anyway - x11 needed that to allow multiple X displays and
broadway, quartz and wayland don't have the concept of displays.

The X11 backend still did things, so I only #if 0'd some code but did
not actually update anything.
2013-04-15 15:43:27 +02:00
Benjamin Otte
7ef508ff4a displaymanager: Handle list of displays in base class
This moves the add/remove_display() functions from the subclasses to
GdkDisplay and GdkDisplayManager. It also gets rid of the list_displays
vfunc.
2013-04-15 15:43:26 +02:00
Benjamin Otte
f7c0b025b9 displaymanager: Move set_default_display vfunc
... to GdkDisplayClass.make_default. It's only implemented by X11
anyway.
2013-04-15 15:43:26 +02:00
Benjamin Otte
839f402191 displaymanager: Handle the default display
... instead of having every backend do it on their own.
2013-04-15 15:43:26 +02:00
Matthias Clasen
bb4fca2486 wayland: Don't get the shell surface twice
Noticed by Pu Xingyu,
https://bugzilla.gnome.org/show_bug.cgi?id=697947
2013-04-13 17:20:05 -04:00
Rob Bradford
bff5b2ae3e wayland: Don't "probe" for a Wayland compositor if started from compositor
In the case that the client is started directly by the compositor the
WAYLAND_SOCKET environment variable is set containing the fd to use that was
created by a socketpair.

This environment variable is consumed by a call to wl_display_connect so a
second call will not take advantage of it.

https://bugzilla.gnome.org/show_bug.cgi?id=697673
2013-04-12 18:43:36 +01:00
Chris Cummins
6deff39f74 wayland: Use more explicit out parameter names
Prevent confusion between positional values and hotspot values.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-04-09 12:52:56 +01:00
Rob Bradford
b37d83e988 wayland: don't leave root window values uninitialised
Under Wayland we don't know the absolute position of the device but there are
some API calls that expect to get an root window position. Previously we were
not assigning any value to these out parameters potentially leaving the values
undefined.

This change returns the current surface relative position of the device.
2013-04-09 12:52:16 +01:00
Matthias Clasen
96982347b3 wayland: Clean up gdkwayland.h
Make this an include-only header
2013-04-08 22:32:50 -04:00
Matthias Clasen
6629e839d0 wayland: Implement gdk_keymap_get_modifier_state 2013-04-06 21:16:38 -04:00
Matthias Clasen
acf56b6cb3 wayland: Fix gdk_keymap_translate_keyboard_state
I was confusing indices and masks here, which made the modifier
translation go wrong. With this commit, accelerators work.
2013-04-06 17:03:27 -04:00
Matthias Clasen
1b2711cde2 wayland: Implement gdk_keymap_translate_keyboard_state 2013-04-06 10:48:57 -04:00
Matthias Clasen
eb9ab7aad4 wayland: Fix up key event translation
The is_modifier field is supposed to be set if the key
would act as a modifier, not if any modifiers are currently
active. To fix this, introduce a private
_gdk_wayland_keymap_key_is_modifier function.

At the same time, make the hardware_keycode field in key
events actually contain the hardware keycode, not a copy
of the keyval.
2013-04-06 10:48:57 -04:00
Matthias Clasen
c659f892ff trivial whitespace fix 2013-04-06 10:48:56 -04:00
Matthias Clasen
720ca63c5d wayland: Return NULL as the keyval name for 0
This is what the X11 backend does, and it makes the "NoSymbol"
disappear from menuitems that don't have an accelerator.
2013-04-06 10:48:56 -04:00
Matthias Clasen
cdcc804730 wayland: Implement more keymap functions
This commit implements gdk_keymap_get_entries_for_keyval
and gdk_keymap_lookup_key.
2013-04-05 07:23:00 -04:00
Matthias Clasen
be1e57db1f wayland: Implement gdk_keymap_get_entries_for_keycode 2013-04-05 07:23:00 -04:00
Matthias Clasen
086789d015 wayland: Always initialize directions
I forgot to initialize directionm in gdk_wayland_keymap_new,
leading to crash.
2013-04-04 21:14:53 -04:00
Matthias Clasen
246f32a58d wayland: Emit ::direction-changed when appropriate
We always emit direction-changed when we get a new keymap, but
for state changes, we compare old and new direction and only
emit the signal when the direction actually changes.
2013-04-03 23:52:52 -04:00
Matthias Clasen
2f8f1ef485 wayland: Implement keymap direction
This is very similar to the X11 implementation.
2013-04-03 23:45:54 -04:00
Pavel Vasin
5d9c07a061 wayland: display: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=696767
2013-04-03 19:20:57 -04:00
Benjamin Otte
a6b29d73d7 gdkdisplay: Remove get_screen() and get_n_screens() vfuncs 2013-04-02 11:45:44 +02:00
Benjamin Otte
e76cb9daca wayland: Remove unused variable 2013-04-01 14:20:46 +02:00
Matthias Clasen
28fab2eea2 Remove an unused filed in GdkWindowImplWayland
The unused toplevel_window_type field was copied over from
the X backend.
2013-03-31 22:46:31 -04:00
Kristian Høgsberg
4252ac6d6c wayland: Set a wayland-client log handler to print errors we get 2013-03-30 14:20:00 -04:00
Kristian Høgsberg
8886c63a4e wayland: Don't error out on G_IO_HUP until we've read G_IO_IN data
We can get G_IO_HUP and G_IO_IN at the same time, if the compositor writes
data to us and then closes our connection.  Make sure that we dispatch events
always if we have G_IO_IN and then error out if we get G_IO_HUP after that.
2013-03-30 14:20:00 -04:00
Chris Cummins
b8ed3e9ef5 wayland: Implement animatable cursors
Cursor animations are handled on a per-device basis, with
GdkWaylandDevice updating the pointer surface for each frame.

https://bugzilla.gnome.org/show_bug.cgi?id=696429
2013-03-28 10:33:57 -04:00
Chris Cummins
4801977d80 wayland: Do not free wayland cursor buffers
The cursor buffer is only non-null when a cursor is created from pixbuf,
so it is not necessary to keep track of whether to free this buffer on
finalize.
2013-03-28 10:33:57 -04:00
Chris Cummins
c022cbae0d wayland: Differentiate wayland and pixbuf cursors
By keeping a pointer to the wl_cursor struct in GdkWaylandCursor, it is
no longer necessary to duplicate cursor data (width, height, hotspots,
etc.) between wl_cursor and GdkWaylandCursor.
2013-03-28 10:33:57 -04:00
Jan Arne Petersen
40c5d37340 docs: Add wayland documentation to Gdk reference 2013-03-27 21:04:05 +01:00
Kristian Høgsberg
abfa4bf0aa wayland: Use the wl_display_sync() request to track pending init roundtrips
Instead of maintaining the init refcount in regular event handlers that can
fire in case of hotplug or mode changes, use a dedicated sync callback
to wait for roundtrips.
2013-03-27 13:44:33 -04:00
Kristian Høgsberg
fc713dffb3 wayland: Pass most recent button press serial to set_popup_surface 2013-03-27 13:39:58 -04:00
Matthias Clasen
4987728d7a wayland: Handle seat removal
Also, emit ::device-added and ::device-removed signals
as devices appear and disappear.
2013-03-26 22:57:46 -04:00
Matthias Clasen
28c865b4e2 wayland: Make monitor removal work
The global_removal argument is the _name_ of the object.
We were comparing it to the _object id_ of the object.
To fix this, store the name at the time the object is bound.
2013-03-26 22:16:15 -04:00
Matthias Clasen
ca09a600c3 wayland: Also emit monitors-changed when monitors are unplugged 2013-03-26 21:53:41 -04:00
Matthias Clasen
27e517a445 wayland: Also emit size-changed when appropriate
We need to be a bit more careful when updating the screen
size - the code that was there would not do the right thing
if e.g. the width of one monitor was reduced.
2013-03-26 21:47:49 -04:00
Matthias Clasen
0489fcffbe wayland: Emit monitors-changed when monitors change 2013-03-26 21:37:21 -04:00
Matthias Clasen
93e5d83a9d Don't decrement the init_ref_count towards -infinity
Once we are at zero, initialization is done.
2013-03-26 21:27:21 -04:00
Kristian Høgsberg
abe7dc6bb4 wayland: Set screen size to bounding box of all outputs
Don't hardcode 8192x8192.  We don't get this info from wayland, so we
compute it as we receive information about the available wl_outputs.

https://bugzilla.gnome.org/show_bug.cgi?id=692871
2013-03-26 17:32:15 -04:00
Kristian Høgsberg
a9e980e578 wayland: Roundtrip until we've receive initial input and output configuration
We use a ref-count mechanism to track whether parts of the init sequence
still needs round trips to receive remaining initial state.  Typically
we need a couple of roundtrips total to get the global list, then the
input and output configurations, but with the ref-count we avoid making
global assumptions like that.

https://bugzilla.gnome.org/show_bug.cgi?id=696340
2013-03-26 14:42:16 -04:00
Matthias Clasen
920ee770ea wayland: Add toolbar settings 2013-03-24 20:21:50 -04:00
Jan Arne Petersen
8d884bb4fb wayland: Add support for custom surfaces
Allow to set a GdkWindow to use a custom surface instead of a
wl_shell_surface. It allows to register the surface as a custom type
with some Wayland interface.

https://bugzilla.gnome.org/show_bug.cgi?id=695861
2013-03-24 14:31:51 -04:00
Matthias Clasen
97ebaee0e2 wayland: Remove a few unused variables 2013-03-23 18:31:20 -04:00
Matthias Clasen
9182eacadf wayland: Don't recreated keymaps on layout change
The GDK model for keymaps expects the keymap object to stay
around and emit a ::keys-changed signal. So, do that. This
should make layout changes work, but it remains untested since
weston does not support layout changes at runtime.

At the same time, plug a memory leak where GdkWaylandKeymap
forgot to free its xkb objects in finalize.
https://bugzilla.gnome.org/show_bug.cgi?id=696339
2013-03-23 18:04:15 -04:00
Matthias Clasen
c6d95a7bdc wayland: remove an unused variable 2013-03-23 17:29:28 -04:00
Matthias Clasen
a70acc03c5 wayland: Respect keymap repeat information
xkb has a function to tell us whether a key should be repeated
or not. Lets use that information.
2013-03-23 17:29:28 -04:00
Matthias Clasen
d2c8b65fd9 wayland: Pick up more settings
With this commit, we pick up xft settings from GSettings
as well. Among other things, this makes the Large Text
setting work. Still to do: pick up fontconfig changes without
having all clients use up inotify watches for all font
directories.
2013-03-23 13:02:09 -04:00
Thomas Wood
09d0d32af0 wayland: implement GInitable and check the connection to the display server
Add GInitable implementation and fail the initialisation if it is not
possible to connect to the display server.

https://bugzilla.gnome.org/show_bug.cgi?id=694465
2013-03-22 22:25:32 -04:00
Matthias Clasen
c61956c592 wayland: Implement cursor theme changing
Add gdk_wayland_display_set_cursor_theme and implement it.
2013-03-22 20:30:51 -04:00
Matthias Clasen
8caf1ae7fd wayland: Respect cursor size setting
Respect the cursor size setting when loading the cursor theme.
2013-03-22 19:32:39 -04:00
Matthias Clasen
3278fb9990 wayland: Add cursor-size setting
This will be picked up by cursor themes soon.
2013-03-22 19:27:36 -04:00
Matthias Clasen
37843faea9 wayland: Avoid segfault when cursors are freed
The check for GDK_CURSOR_IS_PIXMAP was ineffective, since _all_
cursors have this type, from the looks of it. Instead, store
buffer ownership information separately.
2013-03-22 19:09:20 -04:00
Matthias Clasen
cc70ac104d wayland: Emit GdkKeymap::state-changed when appropriate
This makes the caps lock warning in password entries work.
2013-03-22 18:34:44 -04:00
Matthias Clasen
1ea760fbc9 wayland: Make key repeat configurable
These might be candidates for a future settings interface; until
then, we use GSettings directly. Note again that we are careful
to avoid a dependency on GNOME schemas.
2013-03-22 18:26:33 -04:00
Matthias Clasen
659ae5172f wayland: Factor out key repeat parameters
This is in preparation for picking these values up from
existing configuration.
2013-03-22 18:09:23 -04:00
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
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
Rob Bradford
af8e4ee8e7 wayland: Calculate window position offset to give emulated root coordinates
This allows combo box popup windows to appear in the correct place. This is a
workaround emulating root coordinates by calculating the offset for a chain
of windows that that are relative to each other.
2012-04-25 14:36:08 +01:00
Rob Bradford
568b310eb3 wayland: Only update position if the with_move flag is set
This was causing the combobox popup to be moved to (0,0) when just the
size was asserted.
2012-04-25 12:00:40 +01:00
Rob Bradford
55261f4e3f wayland: Improve error message handling in cursor buffer code 2012-04-25 12:00:40 +01:00
Rob Bradford
1aa2a7f821 wayland: Improve the error reporting in the Cairo GL surface code path 2012-04-19 17:59:09 +01:00
Rob Bradford
b5845514ec wayland: Improve error messages during SHM buffer creation
Use g_critical rather than fprintf and and also grab the error messages from
errno and from Cairo
2012-04-19 17:58:59 +01:00
Rob Bradford
cd831b1390 wayland: Expose GdkWaylandDisplayManager as a public GType
This permits a runtime test of whether we are running on the Wayland platform
or not.
2012-04-17 18:40:41 +01:00
Rob Bradford
6f9ad538d9 wayland: Rename GdkScreenWayland to GdkWaylandScreen
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Rob Bradford
fc58ff1e6a wayland: Rename GdkDisplayWayland to GdkWaylandDisplay
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Rob Bradford
71ca53993e wayland: Use an ARGB buffer for the Cairo and SHM surface 2012-04-16 15:09:14 +01:00
Rob Bradford
cddfcf1418 wayland: Force an expose for the whole area when scrolling 2012-04-16 15:09:14 +01:00
Rob Bradford
cdf5c2af62 wayland: Add support for rendering into an SHM buffer with Cairo image backend
The first version of this change included a bug that meant that if you don't
compile for any other backend then it wouldn't search for cairo. Credit for
identifying the bug goes to darxus@chaosreigns.com.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=672361
2012-04-16 15:09:14 +01:00