Commit Graph

250 Commits

Author SHA1 Message Date
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