Commit Graph

553 Commits

Author SHA1 Message Date
Jasper St. Pierre
7052795a80 wayland: Clean up code to find the correct seat for a window 2014-05-15 18:02:45 -04:00
Jasper St. Pierre
38445e6326 wayland: Ack the configure immediately 2014-05-13 16:21:57 -04:00
Jasper St. Pierre
9b4668c82c wayland: Update to latest xdg-shell protocol 2014-05-13 02:39:59 -04:00
Carlos Garnacho
ac5993a7e7 wayland: Fix c&p typo in touch capabilities handling. 2014-05-06 18:37:57 +02:00
Adel Gadllah
b395929a16 gdkscreen-wayland: Emit monitors-changed when the output scale changes
https://bugzilla.gnome.org/show_bug.cgi?id=729013
2014-04-26 17:32:57 +02:00
Carlos Garnacho
1a2a5a44bd wayland: handle the wl_touch interface
The events are routed through a new slave device with type
GDK_SOURCE_TOUCHSCREEN, minimal tracking of touches is done
to keep the state for each of those.

https://bugzilla.gnome.org/show_bug.cgi?id=728426
2014-04-22 23:54:43 -04:00
Carlos Garnacho
af8d6e6549 wayland: Separate master devices from seat capabilities
The master pointer/keyboard pair should never disappear or be
inconsistent. The seat capabilities are now reflected through
slave devices, those may come and go freely as the seat
capabilities change. This also enables adding further capabilities
to handle eg. touch.

https://bugzilla.gnome.org/show_bug.cgi?id=728426
2014-04-22 23:50:55 -04:00
Jasper St. Pierre
ee3d00c391 wayland: Map the window immediately on show 2014-04-22 19:19:14 -04:00
Jasper St. Pierre
4e72674bf3 wayland: Remove useless hint set 2014-04-22 19:19:14 -04:00
Jasper St. Pierre
938725fff0 wayland: Remove VISIBILITY_NOTIFY event
VISIBILITY_NOTIFY is already known to be unreliable.
2014-04-22 19:19:14 -04:00
Jasper St. Pierre
e4e75a94f5 wayland: The xdg_surface.delete event was renamed to close 2014-04-17 13:14:44 -04:00
Jasper St. Pierre
eb5cc3da9b wayland: set_transient_for was renamed to set_parent 2014-04-12 08:20:33 -07:00
Jasper St. Pierre
e91e447db7 wayland: Don't pass dx/dy when we're resizing
They're ignored by the server.
2014-04-12 08:20:33 -07:00
Jasper St. Pierre
8201e2bfab wayland: Merge buffer implementations 2014-04-12 08:20:33 -07:00
Matthias Clasen
6cc0130147 wayland: Mark ourselves as not supporting compositing
The compositing that is meant here is really specific to the
X11 Composite extension, and does not apply to Wayland.

This is very rarely used functionality anyway, and none of
the other backends support it.
2014-03-24 12:49:32 -04:00
Matthias Clasen
a8036a5143 wayland: Fix northeast resizing
Surprisingly, the same corner that was broken for resizing under
X is also broken under Wayland, for an entirely different reason.
2014-03-21 18:24:38 -04:00
Jasper St. Pierre
084859d150 wayland: Mark ourselves as not supporting bounding shapes
Theoretically, we apply the shape mask client-side ourselves
with an ARGB32 pixmap and intersect it to get a union shape,
but I don't particularly care enough to write that code.

Realistic application code using bounding shapes in 2014 is
quite rare.
2014-03-20 14:28:25 -04:00
Jasper St. Pierre
3472235232 wayland: Add support for input regions 2014-03-20 14:28:24 -04:00
Jasper St. Pierre
385b55f203 wayland: Refactor how opaque region is handled
Move to a sync system just like the rest of the properties.
2014-03-20 14:28:24 -04:00
Jasper St. Pierre
16b5504eb9 wayland: Remove cruft in set_keep_above / set_keep_below
It's been decided: these will most likely never be supported on
Wayland, so remove the "stub" implementation of them.
2014-03-17 15:51:46 -04:00
Jasper St. Pierre
4eb7dac75b wayland: Fix get_frame_extents
We need to traverse up the hierarchy for windows here. Just use
our existing helper method for this.
2014-03-17 15:51:46 -04:00
Jasper St. Pierre
efdd68b3b0 Implement get_root_origin generically for all backends
It seems that some backends implemented get_root_origin wrong
and returned the client window coordinates, not the frame window
coordinates. Since it's possible to implement generically for all
windows, let's do that instead of having a separate impl vfunc.
2014-03-17 15:51:46 -04:00
Jasper St. Pierre
0320c3be8e wayland: Fix "fake root" coords
We were incorrectly summing up our own window over and over
rather than the coordinates of the parent windows.
2014-03-17 15:36:41 -04:00
Jasper St. Pierre
494e253e47 wayland: Add a giant doc comment explaining "fake root" coordinate space 2014-03-17 15:36:41 -04:00
Jasper St. Pierre
92833a0b82 wayland: Properly apply the fake root offset to event coordinates
GdkEvent's x_root and y_root values should be in the same "fake root
window" coordinate space as gdk_window_get_root_coords.
2014-03-17 15:36:41 -04:00
Jasper St. Pierre
35a1f49db5 wayland: Fill in x_root / y_root of events properly
Lots of code, including dragging code in GtkWindow, use these
fields. Setting them to 0 causes lots of strange and weird bugs.

Use the same "hack" from query_device_state of just using
win_x / win_y for now. We'll convert this to the proper fake root
coordinate system used by get_root_coords in the next commit.
2014-03-17 15:36:41 -04:00
Jasper St. Pierre
c737045462 xdg-shell: Update to latest state change mechanism 2014-03-12 23:53:04 -04:00
Jasper St. Pierre
fb51bbc565 wayland: Clean up a bit 2014-03-10 13:40:04 -04:00
Jasper St. Pierre
05b8609f80 wayland: Move some code around 2014-03-10 13:40:04 -04:00
Jasper St. Pierre
c92a16fcf5 wayland: Fix submenu positioning
window->x / window->y are in "root window coordinates", e.g. relative
to the topmost toplevel. However, the coordinates in get_xdg_popup are
relative to the passed-in surface, so we need to do the reverse
translation here.
2014-03-10 13:40:04 -04:00
Jasper St. Pierre
b922e0e213 Remove the return value of GdkWindowImpl::get_root_coords
It's unused by callers, and the historical return values are
undocumented, so just remove it now.
2014-02-27 21:06:35 -05:00
Jasper St. Pierre
056ca21e2f wayland: Seal up a non-declared public member 2014-02-27 17:33:09 -05:00
Jasper St. Pierre
7d67530982 wayland: Remove old, outdated comment 2014-02-27 17:00:56 -05:00
Jasper St. Pierre
08d0bedb28 wayland: Fix margins at startup
GtkWindow calls set_shadow_width then maps the window, meaning
that we never set the margin. Save it when we set and then set
it when we create the XDG surface.
2014-02-27 16:55:02 -05:00
Giovanni Campagna
ad2f96ff48 Gdk: fix wrong user_data handling in resize_cairo_surface()
Instead of destroying the surface in the backend if this is
unable to resize, let the core code do it, and do it properly.

Based on a patch by Benjamin Otte.

https://bugzilla.gnome.org/show_bug.cgi?id=725172
2014-02-26 00:04:41 +01:00
Jasper St. Pierre
084c2feb7e wayland: Don't destroy the cairo surface when resizing it
The code in GDK is incredibly broken and nobody is quite sure what's
right-side-up and what's upside down, but this breaks mutter-wayland
now, so let's remove it. It might leak, but we should probably do a
full restructuring of GDK drawing to fix it.
2014-02-23 16:07:38 -05:00
Rui Matos
6ea4bf8a9d wayland: Fix gdk_window_wayland_resize_cairo_surface()
Like in other backends (except X) we can't resize cairo image surfaces
so let's sync the code here with what the other backends do.

This prevents the painting machinery above us to paint on the wrong
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=724968
2014-02-23 18:40:29 +01:00
Jasper St. Pierre
7fbcff8d71 xdg-shell: Update for focused_set / focused_unset rename 2014-02-18 16:48:42 -05:00
Jasper St. Pierre
6845eade49 wayland: Update to new xdg-shell pinging standards 2014-02-18 16:47:34 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
Jasper St. Pierre
bfe8a354cd wayland: Add support for set_shadow_width 2014-02-07 19:33:17 -05:00
Jasper St. Pierre
c52e710dc8 wayland: Add support for delete event 2014-02-07 18:30:12 -05:00
Jasper St. Pierre
b14e86fad2 wayland: Remove edges from configure 2014-02-07 18:30:07 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
Matthias Clasen
8e797c1195 Wayland: Set gtk-dialogs-use-header
Since we don't have a setting for this, hardcode the value
for now.
2014-02-06 22:51:05 -05:00
Jasper St. Pierre
e583e3ebce gdkwindow-wayland: Make function order match listener order 2014-02-06 14:29:18 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
8d6717097c docs: Use markdown for ulinks 2014-02-04 16:58:53 -05:00
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