Commit Graph

250 Commits

Author SHA1 Message Date
Jasper St. Pierre
c539dfe0d7 weston-launch: Pass the DRM device to Cogl
Open the device from weston-launch, and pass it to Cogl/Clutter.
This is a preliminary cleanup for our login1 integration.
2014-03-14 14:13:05 -04:00
Jasper St. Pierre
a9d8107c3d window: Replace meta_window_type_changed with meta_window_set_type
Which does the equality checking for us.
2014-03-13 17:14:28 -04:00
Jasper St. Pierre
d1ea17e6a4 meta-weston-launch: Adapt to Clutter's new evdev open callback 2014-03-13 12:47:11 -04:00
Jasper St. Pierre
b37ad66e9d xdg-shell: Update for new state change mechanism
We're still not properly going through the request system. This
will require a dense investigation of the code, but it will happen
soon...
2014-03-12 23:42:55 -04:00
Matthias Clasen
c1f15348a5 Revert "weston-launch: Pass the DRM device to Cogl"
This reverts commit 857561baed.

This broke the build, and was pushed prematurely.
2014-03-12 14:48:46 -04:00
Jasper St. Pierre
857561baed weston-launch: Pass the DRM device to Cogl
Open the device from weston-launch, and pass it to Cogl/Clutter.
This is a preliminary cleanup for our login1 integration.
2014-03-11 18:01:21 -04:00
Jasper St. Pierre
a44cc9ef47 wayland: Fix build 2014-03-11 18:01:17 -04:00
Jasper St. Pierre
d47b7ba038 Add meta_activate_session
This will be used on startup to switch to the newly activated session.
2014-03-11 17:25:40 -04:00
Jasper St. Pierre
f21312e2fd meta-weston-launch: Redraw and update the cursor when switching back 2014-03-11 17:25:40 -04:00
Jasper St. Pierre
394af33607 weston-launch: Allow activating our own VT by passing a negative value
This will be used to implement activate_session.
2014-03-11 17:25:40 -04:00
Jasper St. Pierre
7314cdac94 weston-launch: Always use sd_session_get_vt 2014-03-11 17:25:40 -04:00
Jasper St. Pierre
81025e37ea weston-launch: Stat the path before opening it 2014-03-11 17:25:39 -04:00
Jasper St. Pierre
1bb9f1e333 weston-launch: Remove unused prototypes 2014-03-11 17:25:39 -04:00
Jasper St. Pierre
b11c75c1c9 weston-launch: Rearrange code slightly
We need to initialize the main loops before our callback is called, so
this makes it make a slight bit of more sense.
2014-03-11 17:25:39 -04:00
Jasper St. Pierre
757b626aee wayland: Add a few comments, rename some strings 2014-03-11 17:25:02 -04:00
Jasper St. Pierre
e34792d9f0 wayland: Remove needless indirection 2014-03-11 16:00:43 -04:00
Jasper St. Pierre
f397c32192 wayland: Make set_selection private
It's unused outside of us.
2014-03-11 15:42:37 -04:00
Jasper St. Pierre
f79314d7b5 wayland: Fix destroying data sources
The resource is not embedded in the source, it's separate. We need
to get the user data here to not crash.
2014-03-11 15:30:17 -04:00
Jasper St. Pierre
55c61259d8 wayland: Use g_slice_new0
And fix a leak.
2014-03-11 15:30:17 -04:00
Jasper St. Pierre
5298cf0a3a wayland: Pull in a fix for a FIXME from Weston 2014-03-11 15:30:17 -04:00
Jasper St. Pierre
f1dc1a0cbc wayland: Fix drag grabs
We need to have the seat here. This makes weston-dnd not crash when
clicking on an item.
2014-03-11 15:30:16 -04:00
Jasper St. Pierre
9df8e831be xwayland: Make sure to clear an existing surface if we have one
This fixes an assert fail when redecorating an X11 client.
2014-03-11 10:24:13 -04:00
Jasper St. Pierre
84c6b2a3fa wayland: Remove an extra reset
We already reset the double-buffered state when we commit it, so this
is just superfluous.
2014-03-11 10:24:13 -04:00
Jasper St. Pierre
06cd669ccb wayland: Fix bad copy-paste error in unset_fullscreen
This was causing memory corruption and a bad crasher with simple-egl.
2014-03-10 16:45:05 -04:00
Jasper St. Pierre
81eb7d9537 Add META_GRAB_OP_WAYLAND_CLIENT
Which is used for Wayland popup grabs.

The issue here is that we don't want the code that raises or focuses
windows based on mouse ops to run while a client has a grab.

We still keep the "old" grab infrastructure in place for now, but
ideally we'd replace it eventually with a better grab-op infrastructure.
2014-03-10 15:11:03 -04:00
Jasper St. Pierre
dd8d8e436d wayland: Remove special code for modal grabs
Since we never pass any Clutter events to Wayland, it's not needed.
2014-03-10 15:10:44 -04:00
Jasper St. Pierre
d6b6b363ad seat: Add support for smooth scrolling 2014-03-10 11:36:36 -04:00
Jasper St. Pierre
254e2e993c seat: Redo scroll handling
To make way for smooth scrolling
2014-03-10 11:36:36 -04:00
Jasper St. Pierre
c595a9c29f seat: Reduce indentation 2014-03-10 11:36:36 -04:00
Rui Matos
dfc7f7222b wayland-keyboard: Remove unused modifier indexes
This was copied from weston where they're used for compositor
keybindings. Mutter has its own keybindings code which doesn't need
this.

https://bugzilla.gnome.org/show_bug.cgi?id=722847
2014-03-07 15:00:04 +01:00
Jasper St. Pierre
ddc171220a wayland: Remove destroy listener
Do to a bad mixup, the surface listener was never actually fired.
This was accidentally fixed as part of a refactoring in a27fb19,
but the surface listener was broken, and we started crashing. To
fix, just remove the surface listener, as we've mostly been testing
without it.
2014-02-28 13:20:42 -05:00
Rui Matos
0313b38dd6 wayland: Don't try to disconnect the listener from the signal handler
This is not needed since the instance is being destroyed and in fact
actively harmful when code called from other handlers disconnects us
for other reasons. In that case we might crash because the
disconnection doesn't prevent other handlers from running in the
current signal emission and thus we try to remove ourselves from an
empty list.
2014-02-28 13:20:42 -05:00
Jasper St. Pierre
770b58b367 wayland: Move "public" Wayland API to another header file 2014-02-28 10:24:06 -05:00
Jasper St. Pierre
77838c2ca3 wayland: Do a giant code cleanup
This changes the user data of all surface extensions resources to be
the MetaWaylandSurface instead of the MetaWaylandSurfaceExtension,
which means that we no longer need all these pesky wl_container_ofs
in implementations.
2014-02-28 09:07:33 -05:00
Jasper St. Pierre
e56cbfbd0f wayland: Rearrange create_surface_extension a tiny bit
This moves all the "uninteresting" variables we pass to the end.
2014-02-28 09:07:33 -05:00
Jasper St. Pierre
a27fb19473 wayland: Do a small code cleanup
Pass the surface rather than the resource / client. This will become
a lot more helpful in the next commit.
2014-02-28 09:07:33 -05:00
Jasper St. Pierre
86c1c30245 wayland: Add back wl_shell support 2014-02-28 08:32:14 -05:00
Jasper St. Pierre
283546b379 wayland: Enable destroy animations for regular windows
Don't set the surface actor to a new buffer if it's becoming unmapped.
This is also technically wrong since we'll send out the release event,
but oh well.

We should probably decouple MetaWaylandBuffer from the CoglTexture
at some point, so we can send out releases on-demand.
2014-02-27 23:48:00 -05:00
Giovanni Campagna
45624f2edf MetaWindowActor: survive having no MetaSurfaceActor
We need a MetaWaylandSurface to build a MetaSurfaceActor, but
we don't have one until we get the set_window_xid() call from
XWayland. On the other hand, plugins expect to see the window
actor right from when the window is created, so we need this
empty state.

Based on a patch by Jasper St. Pierre.
2014-02-25 01:22:56 +01:00
Jasper St. Pierre
f0cd9b0687 wayland-surface: Rework construction / destruction yet again
This time, to make way for MetaSurfaceActorEmpty. This also fixes
destroy effects as a side effect. It still has issues if we try
to re-assign an actor that's already toplevel (e.g. somebody
re-popping up a menu that's already being destroyed), but this
will be fixed soon.

The idea here is that MetaWindowActor will do the unparenting of
the surface actor when it itself is destroyed. To prevent bad issues
with picking, we only make the surface actor reactive when it's
toplevel.
2014-02-24 14:46:19 -05:00
Jasper St. Pierre
1783bf20ec Revert "window: Delay the showing of XWayland clients until set_window_id"
This reverts commit 59c8b949ad.
2014-02-24 14:46:19 -05:00
Jasper St. Pierre
ff8c4b1bcf pointer/keyboard: Fix segfault once more
If the resource is destroyed before the surface, then we'll kill
ourselves. Why can I never seem to write these correctly...
2014-02-23 10:00:31 -05:00
Jasper St. Pierre
337c69e223 pointer/keyboard: Unset focus_resource when the surface is destroyed
focus_resource is supposed to be set only if focus_surface is
as well.
2014-02-22 18:15:53 -05:00
Jasper St. Pierre
83aca0b53d window-actor: Split into two subclasses of MetaSurfaceActor
The rendering logic before was somewhat complex. We had three independent
cases to take into account when doing rendering:

  * X11 compositor. In this case, we're a traditional X11 compositor,
    not a Wayland compositor. We use XCompositeNameWindowPixmap to get
    the backing pixmap for the window, and deal with the COMPOSITE
    extension messiness.

    In this case, meta_is_wayland_compositor() is FALSE.

  * Wayland clients. In this case, we're a Wayland compositor managing
    Wayland surfaces. The rendering for this is fairly straightforward,
    as Cogl handles most of the complexity with EGL and SHM buffers...
    Wayland clients give us the input and opaque regions through
    wl_surface.

    In this case, meta_is_wayland_compositor() is TRUE and
    priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND.

  * XWayland clients. In this case, we're a Wayland compositor, like
    above, and XWayland hands us Wayland surfaces. XWayland handles
    the COMPOSITE extension messiness for us, and hands us a buffer
    like any other Wayland client. We have to fetch the input and
    opaque regions from the X11 window ourselves.

    In this case, meta_is_wayland_compositor() is TRUE and
    priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11.

We now split the rendering logic into two subclasses, which are:

  * MetaSurfaceActorX11, which handles the X11 compositor case, in that
    it uses XCompositeNameWindowPixmap to get the backing pixmap, and
    deal with all the COMPOSITE extension messiness.

  * MetaSurfaceActorWayland, which handles the Wayland compositor case
    for both native Wayland clients and XWayland clients. XWayland handles
    COMPOSITE for us, and handles pushing a surface over through the
    xf86-video-wayland DDX.

Frame sync is still in MetaWindowActor, as it needs to work for both the
X11 compositor and XWayland client cases. When Wayland's video display
protocol lands, this will need to be significantly overhauled, as it would
have to work for any wl_surface, including subsurfaces, so we would need
surface-level discretion.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-20 14:44:31 -05:00
Jasper St. Pierre
7ebf5aa69a pointer/keyboard: Properly handle destruction
If the client destroys the pointer resource, we shouldn't unfocus the
surface, and we should regrab it when the client gets the pointer
resource again.

This also fixes a crash at surface destruction because of the unchecked
wl_link_remove that will happen on both pointer and surface destroy.
2014-02-20 11:35:01 -05:00
Marek Chalupa
17462c21e8 pointer/keyboard: fix setting focus
Set focus to NULL after using the variable
2014-02-19 10:24:36 -05:00
Jasper St. Pierre
48f7232492 pointer: Don't send modifiers on mouse enter
I talked to Kristian about this. It should be enough to simply
send it when we activate the surface and give it keyboard focus.
2014-02-18 23:21:06 -05:00
Jasper St. Pierre
ff5867e4d3 pointer: Make the code here a bit clearer 2014-02-18 23:21:06 -05:00
Jasper St. Pierre
a5d950f453 pointer/keyboard: Fix focus setting once again
Yet another large-scale restructuring... this is some messy code.
2014-02-18 23:21:06 -05:00
Jasper St. Pierre
7615d17293 wayland: Tie activate / deactivate to appears-focused
... rather than actual focus. This makes things behave better.
2014-02-18 23:21:06 -05:00