summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* wayland: Don't access the cursor wl_buffer when updating the spriteJonas Ådahl2016-03-031-16/+13
| | | | | | | | | | | | | | We may have released the wl_buffer already when doing this, which means we should not try to access the wl_buffer content. Regarding the cursor texture this is not an issue since we can just use the texture created in apply_pending_state(). The hw cursor however will only be realized if the surface is already using the the buffer (surface->using_buffer == true). This will, at the moment, effectively disable hardware cursors for SHM buffers. https://bugzilla.gnome.org/show_bug.cgi?id=762828
* wayland: Close primary selection fd after gtk_primary_selection_source.sendCarlos Garnacho2016-03-011-0/+1
| | | | We leak the fd otherwise.
* wayland: Don't unset surface->buffer when wl_buffer destroyedJonas Ådahl2016-03-014-48/+40
| | | | | | | | | | | | | | | Don't unset the surface->buffer if the associated wl_buffer object is destroyed. The MetaWaylandBuffer doesn't really only represent a wl_buffer object, but also the data (texture) created from the given wl_buffer. Thus, for example destroying a released SHM wl_buffer should not destroy the MetaWaylandBuffer instance, because the texture may still be used. This commit also fixes a race where calc_showing would hide a window because, at the time of calculation whether it should be showing, the surface's buffer had been destroyed as described above. https://bugzilla.gnome.org/show_bug.cgi?id=762716
* wayland: Ensure harder we're dealing with DnD offers/sourcesCarlos Garnacho2016-02-291-1/+5
| | | | | | | | | In destroy_data_offer() there is code to ensure compatibility when dragging from a v3 wl_data_device to a v2 one, it's however not checking correctly that this is the DnD drag source. The other path should be used otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=762878
* wayland: Use separate destructor for the gtk_primary_selection_offerCarlos Garnacho2016-02-291-1/+23
| | | | | | | Things don't mix well if we use the same destructor than wl_data_offer, Use a separate destructor with no DnD paths whatsoever. https://bugzilla.gnome.org/show_bug.cgi?id=762878
* wayland: Implement the (so far internal) primary selection protocolCarlos Garnacho2016-02-264-25/+368
| | | | | | | | | | | | | Add an additional MetaWaylandDataSource implementation for primary selection sources, and methods to set primary selection offers. Primary selection sets altogether a different channel than the clipboard selection, those don't cross in any way. Also, the bridge for the X11 PRIMARY selection atom has been added, which adds all the necessary handling to translate primary selection both ways with wayland and X11 applications. https://bugzilla.gnome.org/show_bug.cgi?id=762560
* wayland: Add gtk-primary-selection protocolCarlos Garnacho2016-02-262-0/+228
| | | | | | | | This protocol is an internal mirror of the primary selection drafts being proposed for wayland-protocols. No changes besides prefix/suffix changes. https://bugzilla.gnome.org/show_bug.cgi?id=762560
* backends: rate-filter the emission of MetaBackend::last-device-changed signalCarlos Garnacho2016-02-261-16/+44
| | | | | | | | | | | | | It indirectly triggers expensive operations in gnome-shell (js/ui/keyboard.js), which turns out too expensive if we happen to operate the shell simultaneously with 2 devices that will trigger the operations there. So just rate limit the signal emission, defer to an idle and just emit the last device gotten. Worst that will happen is that we may possibly emit the signal on the same device consecutively. https://bugzilla.gnome.org/show_bug.cgi?id=753527
* tests: Test scheduling a later MetaLater from a later callback worksJonas Ådahl2016-02-261-0/+91
| | | | | | | The added test tests for the bug fixed by "MetaLater: Invoke later callbacks queued by earlier ones". https://bugzilla.gnome.org/show_bug.cgi?id=755605
* MetaLater: Invoke later callbacks queued by earlier onesJonas Ådahl2016-02-261-35/+68
| | | | | | | | | | | If a MetaLater callback queued another MetaLater with a scheduling later than the one currently being invoked, make it so that the newly scheduled callback will actually be invoked. The fact that it doesn't already do this is a regression from cd7a9680932868d1d2ef5447c77712cef9a443dd. https://bugzilla.gnome.org/show_bug.cgi?id=755605
* tests: Add unit tests framework runnerJonas Ådahl2016-02-262-4/+159
| | | | | | | | | | | | Separate from meta-test-runner which runs metatests testing window manager operations, a new test program (mutter-unit-tests) is introduced. This is meant to run unit test like tests on various units in mutter. An initial test testing the order of MetaLater callback invokation was added. https://bugzilla.gnome.org/show_bug.cgi?id=755605
* MetaWaylandPointerConstraint: Don't expose internal functionJonas Ådahl2016-02-252-3/+1
| | | | | It was exposed via meta-wayland-pointer-constraints.h for no apparent reason.
* MetaWaylandPointerConstraint: Ignore requests on defunct resourceJonas Ådahl2016-02-251-1/+7
| | | | | | | The constraint may be destroyed before the client destroyes the protocol object, for example if a oneshot constraint was disabled by alt-tab. Therefore we need to NULL check the constraint in request handlers and ignore any requests to defunct objects.
* MetaWaylandPointerConstraint: Remove redundant typedefJonas Ådahl2016-02-251-2/+0
|
* MetaWaylandPointerConstraint: Remove unused functionJonas Ådahl2016-02-252-8/+0
|
* Add --nested command line argumentJonas Ådahl2016-02-221-7/+23
| | | | | | | | | | As of "core: start as wayland display server when XDG_SESSION_TYPE=wayland" it is no longer possible to run a nested mutter Wayland session on top of another Wayland session. This patch adds a command line argument to make it possible to force mutter to start as a nested compositor. https://bugzilla.gnome.org/show_bug.cgi?id=758658
* wayland: Implement gtk-shell v3Carlos Garnacho2016-02-192-3/+16
| | | | | | | Implement the gtk_shell.set_startup_id request, so that the ID is removed from the sequences list, and feedback updated accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=762268
* wayland: Update gtk-shell protocol file to v3Carlos Garnacho2016-02-191-2/+6
| | | | | | | | Add a gtk_shell.set_startup_id request, so the application can communicate to the compositor the startup id that it received through the DESKTOP_STARTUP_ID envvar, or other means. https://bugzilla.gnome.org/show_bug.cgi?id=762268
* core: Refactor startup notification into a separate objectCarlos Garnacho2016-02-198-283/+841
| | | | | | | | | | | | | | This is kind of in a middle ground at the moment. Even though it handles sequences not coming from libsn, they're added nowhere at the moment, we'll rely on the app launch context being in the x11 side at the moment. Also, even though we do create internal sequence objects, we keep exposing SnStartupSequences to make gnome-shell happy, we could consider making this object "public" (and the sequence objects with it), things stay private at the moment. https://bugzilla.gnome.org/show_bug.cgi?id=762268
* wayland: change accessible boolean to use_count counterRay Strode2016-02-194-24/+41
| | | | | | | | | | | | | | | Since a buffer can be used by multiple surfaces at once, we need to release the buffer only after all surfaces are finished with it. Currently we track whether or not to release the buffer based on the accessible boolean. This commit changes it to a counter to accomodate multiple users. Also, each surface needs to know whether not it is done with the buffer, so this commit adds a buffer_used boolean to the surface state. https://bugzilla.gnome.org/show_bug.cgi?id=761613
* wayland: get rid of buffer->copied_data booleanRay Strode2016-02-193-5/+10
| | | | | | | | | | | | | | | | | We currently track whether or not a buffer can be released early by looking at the copied_data boolean on the buffer. This boolean is, practically speaking, always set to TRUE for shm buffers and is always false otherwise. We can just as easily check if the buffer is a shm buffer to decide whether or not to do an early release. That's better from a theoretical point of view since copied_data assumes a 1-to-1 relationship between surface and buffer, which may not actually hold. This commit drops copied_data and changes the check to instead see if the buffer is shm. https://bugzilla.gnome.org/show_bug.cgi?id=761613
* window: check for possible loop in transientsOlivier Fourdan2016-02-181-0/+21
| | | | | | | | | | | | | If a broken or naughty application tries set up its windows to create a loop in the transient relationship, mutter will hang, looping forever in meta_window_foreach_ancestor() To avoid looping infinitely at various point in the code, check for a possible loop when setting the transient relationship and deny the request to set a window transient for another if that would create a loop. Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759299
* wayland: return from toplevel commit early if no new bufferRay Strode2016-02-171-0/+6
| | | | | | | | | | meta_wayland_surface_toplevel_commit has a lot of logic to handle a new buffer getting attached as part of the commit. None of that code needs to run if there is no new buffer attached. This commit short-circuits that case. https://bugzilla.gnome.org/show_bug.cgi?id=761613
* native: Don't wait for a new input event to wrap the pointerJonas Ådahl2016-02-161-0/+6
| | | | | | | | If we rely on getting back an input event with the warped pointer coordinates, we might draw a frame with the old coordinates if we warp during the paint phase. Avoid that by moving the cursor immediately. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* MetaPointerConfinementWayland: Support non-rectangular confinement regionsJonas Ådahl2016-02-161-60/+567
| | | | | | | | | This patch adds support for confinement regions that are more complex than a single rectangle. It relies on details about cairo regions not explicitly in the API in order to generate the outer border of the region. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: Use the event coordinates when sending pointer motion eventsJonas Ådahl2016-02-161-4/+7
| | | | | | | | | The x/y coordinates of the ClutterInputDevice were not the ones which was the result of this event but whatever event was queued the last. The correct coordinates can, however, be found in the event itself, so lets use those. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* MetaBorder: Use float constants and functions instead of double variantsJonas Ådahl2016-02-161-1/+1
| | | | | | We calculate with floats, so lets use that type throughout. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* Implement support for the wp_pointer_constraints protocolJonas Ådahl2016-02-1618-1/+1521
| | | | | | | | | | | | | | | | | | | | | | The wp_pointer_constraints protocol is a protocol which enables clients to manipulate the behavior of the pointer cursor associated with a seat. Currently available constraints are locking the pointer to a static position, and confining the pointer to a given region. Currently locking is fully implemented, and confining is implemented for rectangular confinement regions. What else is lacking is less troublesome semantics for enabling the lock or confinement; currently the only requirement implemented is that the window that appears focused is the one that may aquire the lock. This means that a pointer could be 'stolen' by creating a new window that receives active focus, or when using focus-follows-mouse, a pointer passes a window that has requested a lock. This semantics can be changed and the protocol itself allows any semantics as seems fit. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: Make the pending surface state a GObjectJonas Ådahl2016-02-162-32/+79
| | | | | | | | Making the pending state an GObject makes it easier to extend it with additional optional state without putting everything inside one big struct. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: Add "painting" signal to surface actorJonas Ådahl2016-02-162-1/+30
| | | | | | | Make MetaWaylandSurface a listener and move output state updating to the handler function. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* native: Update to new constrain callback APIJonas Ådahl2016-02-161-4/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744104
* Move out generic math parts out of the native barrier implementationJonas Ådahl2016-02-167-178/+292
| | | | | | | | | In order to reuse some vector math for pointer confinement, move out those parts to its own file, introducing the types old types "MetaVector2" and "MetaLine2" outside of meta-barrier-native.c, as well as introducing MetaBorder which is a line, with a blocking direction. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: Add global to surface coordinate helperJonas Ådahl2016-02-163-4/+24
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: Implement support for wp_relative_pointerJonas Ådahl2016-02-167-1/+215
| | | | | | | | | | Add support for sending relative pointer motion deltas to clients who request such events by creating wp_relative_pointer objects via wp_relative_pointer_manager. This currently implements the unstable version 1 from wayland-protocols. https://bugzilla.gnome.org/show_bug.cgi?id=744104
* wayland: use glib function for fetching timestampRay Strode2016-02-081-9/+1
| | | | | | | | | | | | The code currently implements a function, get_time, that fetches a timestamp. That duplicates code already in glib, and the glib implementation is better, anyway, since it doesn't skew backward when the system clock is changed. This commit changes the code to use g_get_monotonic_time and drop the get_time function. https://bugzilla.gnome.org/show_bug.cgi?id=761613
* cursor-renderer-native: Re-use cogl's gbm deviceRui Matos2016-02-041-4/+1
| | | | | | | | Instancing a gbm device without initializing EGL with it means that it won't be able to import wl_drm buffers. Instead, let's re-use cogl's gbm device which is already properly initialized. https://bugzilla.gnome.org/show_bug.cgi?id=761557
* theme: Take invisible borders required by the theme into accountFlorian Müllner2016-02-042-4/+18
| | | | | | | | | | | GTK+ paints some elements like box shadows (which Adwaita likes to (ab)use for borders) outside the rectangle passed to gtk_render_*. This is not an issue if our own invisible frame border is big enough, but in case of non-resizable windows we end up clipping away part of the decoration. Use the newly added gtk_render_background_get_clip() to make sure we always use a mask that is large enough to contain all decorations. https://bugzilla.gnome.org/show_bug.cgi?id=752794
* theme: Update style context hierarchy (again)Florian Müllner2016-02-043-3/+13
| | | | | GtkWindow actually uses two CSS nodes, 'window' and 'decoration'. Simulate that by using two separate style contexts for the frame.
* frames: don't force dark theme to all windowsAlberts Muktupāvels2016-02-041-8/+4
| | | | | | | | Use global theme variant only if window does not have _GTK_THEME_VARIANT property. This allows applications to request default theme variant when global dark theme is enabled. https://bugzilla.gnome.org/show_bug.cgi?id=761543
* frames: default theme variant now is set as empty stringAlberts Muktupāvels2016-02-041-1/+1
| | | | | | | Related change in GTK+: https://git.gnome.org/browse/gtk+/commit/?id=8eb261988869608604c78ed90de5579beb4ef2b0 https://bugzilla.gnome.org/show_bug.cgi?id=761543
* wayland: don't prematurely release EGL buffersRay Strode2016-02-023-1/+5
| | | | | | | | | | | | | | commit 0165cb697466ba0843b993416e00d4f768c00d45 changed mutter to release committed shm buffers as soon as they were uploaded to the GPU. It also inadvertently changed mutter to prematurely release EGL buffers (which never get copied, but get used directly). This commit corrects that mistake. https://bugzilla.gnome.org/show_bug.cgi?id=761312
* wayland: release buffer after processing commitRay Strode2016-02-013-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | When a client is ready for the compositor to read a surface's shared memory buffer, it tells the compositor via wl_surface_commit. From that point forward, the baton is given to the compositor: it knows it can read the buffer without worring about the client making changes out from under it. After the compositor has uploaded the pixel contents to the video card it is supposed to release the buffer back to the client so that the client can reuse it for future use. At the moment, mutter only releases the buffer when a new buffer is attached. This is problematic, since it means the client has to have a second buffer prepared before the compositor gives the first one back. Preparing the second buffer potentially involves copying megabytes of pixel data, so that's suboptimal, and there's no reason mutter couldn't release the buffer earlier. This commit changes mutter to release a surface's buffer as soon as it's done processing the commit request. https://bugzilla.gnome.org/show_bug.cgi?id=761312
* meta-launcher: Use g_auto* macrosRui Matos2016-01-251-27/+19
| | | | | | This fixes a couple of minor memory leaks. https://bugzilla.gnome.org/show_bug.cgi?id=760670
* window-x11: Fix checks for a bounding region input regionJasper St. Pierre2016-01-221-3/+3
| | | | | | | When cleaning up the logic in commit c408cf7, I forgot to properly apply de Morgan's laws to an inverse. Reported by ricotz on IRC.
* Shut up some compiler warningsFlorian Müllner2016-01-211-2/+2
|
* theme: Support margins on titlebar title/buttonsFlorian Müllner2016-01-212-3/+34
| | | | | | GTK+ improved its CSS support, and the default theme started to make use of it, so we must update our theming code accordingly. Add support for margins where they make sense.
* theme: Consider minimum sizesFlorian Müllner2016-01-212-4/+29
| | | | | | GTK+ improved its CSS support, and the default theme started to make use of it, so we must update our theming code accordingly. Start by supporting min-width/min-height where it makes sense.
* cursor-tracker: Port to GdkSeat APIRui Matos2016-01-211-3/+3
|
* meta-launcher: don't call g_object_unref() on NULLMarek Chalupa2016-01-211-7/+9
| | | | | | g_object_unref() was called no matter what we got for value https://bugzilla.gnome.org/show_bug.cgi?id=760670
* MetaWaylandDataDevice: Don't set surface offset as anchor offsetJonas Ådahl2016-01-193-23/+1
| | | | | | | | | | | | Since we are using the surface actor to draw the DND icon, the offset is already accounted for by MetaSurfaceActorWayland, and passing the surface position offset would effectively double the actual offset, causing the icon to be misplaced. This patch always sets the anchor offset to (0, 0) when the icon is a Wayland surface, and lets the surface actor deal with the offsetting. https://bugzilla.gnome.org/show_bug.cgi?id=759222