summaryrefslogtreecommitdiff
path: root/src/backends
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* Implement support for the wp_pointer_constraints protocolJonas Ådahl2016-02-165-0/+156
| | | | | | | | | | | | | | | | | | | | | | 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
* 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-164-178/+52
| | | | | | | | | 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: Implement support for wp_relative_pointerJonas Ådahl2016-02-163-0/+55
| | | | | | | | | | 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
* 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
* 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
* 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
* idle-monitor-native: Don't leak user active watchesRui Matos2016-01-111-44/+24
| | | | | | | | | | | | This fixes an issue analogous to bug 760330 for the X11 backend, except on this backend we wouldn't crash accessing free'd memory. Instead we're leaking watches since we steal them from the hash table which means that when they're removed in _meta_idle_monitor_watch_fire() they're no longer there and thus they're never free'd. https://bugzilla.gnome.org/show_bug.cgi?id=760476
* idle-monitor-xsync: fix crash if watch callback removes different watchRay Strode2016-01-111-21/+27
| | | | | | | | | | | | | | Right now the XSync based idle monitoring code, will fetch all active watches into a list, and then call their watch callbacks one by one as necessary. If one watch callback invalidates another watch, the list will contain free'd memory. This commit makes sure to consult the hash table after ever call of a watch callback, to ensure mutter never looks at freed memory. Fixes crash reported on IRC by Laine Stump with his synergy setup. https://bugzilla.gnome.org/show_bug.cgi?id=760330
* cursor-renderer-native: Avoid a crash if we fail to allocate a gbm boRui Matos2016-01-111-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=758613
* monitor-manager-xrandr: Don't query legacy propertiesJasper St. Pierre2016-01-091-6/+0
| | | | | This never could have worked -- the Atom name it was querying was a root window property, not an output property.
* native: Don't leak DRM plane resourcesRui Matos2016-01-071-0/+2
|
* native: Implement DRM-based crtc rotationCarlos Garnacho2016-01-072-0/+174
| | | | | | | | | | | | | | | | | | | | | | | We can know the rotation modes supported by the driver, so export these as our supported modes, and ensure these modes are honored on the CRTC primary plane upon apply_configuration(). It is worth noting however that not all hardware will be capable of supporting all rotation modes (in fact, most of them won't). A driver independent solution should be in place to back up the rotation modes unsupported by the drivers, so this is still a partial solution. The cursor renderer has also been changed to default to software-based rendering anytime the cursor enters a rotated CRTC. Another solution would be actually rotating the DRM cursor planes, but then it requires applying rotation on these per-CRTC, and actually transforming the pointer position by the output matrix. This brings marginal gains, so we use the "sw" rendered cursor, which will be transformed together with the primary plane. https://bugzilla.gnome.org/show_bug.cgi?id=745079
* backends: Fix cut'n'paste error in click method settingBastien Nocera2015-12-151-1/+1
| | | | | | | | GDesktopTouchpadScrollMethod was used instead of GDesktopTouchpadClickMethod which became visible now that the former has been removed from gsettings-desktop-schemas. https://bugzilla.gnome.org/show_bug.cgi?id=759304
* backends: Force 2-finger scroll by default if availableBastien Nocera2015-12-154-53/+48
| | | | | | | | | | | | When the touchpad is two-finger scrolling capable, always enable it. When the touchpad only supports edge scrolling (usually older devices, and usually smaller devices), allow disabling the edge scrolling. This requires a newer gsettings-desktop-schemas as the scroll-method key was removed, and the edge-scroll-enabled key added. https://bugzilla.gnome.org/show_bug.cgi?id=759304
* monitor-manager: Fix the max potential number of logical monitorsRui Matos2015-11-291-1/+1
| | | | | | | | | | | | | The max potential number of logical monitors (i.e. MetaMonitorInfos) is the number of CRTCs, not the number of outputs. In cases where we have more enabled CRTCs than connected outputs we would end up appending more MetaMonitorInfos to the GArray than the size it was initialized with which means the array would get re-allocated rendering invalid some MetaCRTC->logical_monitor pointers assigned previously and thus ending in crashes later on. https://bugzilla.gnome.org/show_bug.cgi?id=751638
* cursor-renderer: do not update cursor if it is out of monitorMarek Chalupa2015-11-291-0/+15
| | | | | | | if the cursor coordinates are out of monitor, just don't render the cursor https://bugzilla.gnome.org/show_bug.cgi?id=756698
* KMS/Wayland: Correct refresh rate unitsDaniel Stone2015-11-251-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the wire, Wayland specifies the refresh rate in milliHz. Mutter sends the refresh rate in Hz, which confuses clients, e.g. weston-info: interface: 'wl_output', version: 2, name: 4 mode: width: 2560 px, height: 1440 px, refresh: 0 Hz, flags: current preferred interface: 'wl_output', version: 2, name: 5 mode: width: 3200 px, height: 1800 px, refresh: 0 Hz, flags: current preferred and xrandr: XWAYLAND0 connected 2560x1440+3200+0 600mm x 340mm 2560x1440@0.1Hz 0.05*+ XWAYLAND1 connected 3200x1800+0+0 290mm x 170mm 3200x1800@0.1Hz 0.03*+ Export the refresh rate in the correct units. For improved precision, perform the KMS intermediate calculations in milliHz as well, and account for interlaced/doublescan modes. This is also consistent with what GTK+ expects: timings->refresh_interval = 16667; /* default to 1/60th of a second */ /* We pick a random output out of the outputs that the window touches * The rate here is in milli-hertz */ int refresh_rate = _gdk_wayland_screen_get_output_refresh_rate (wayland_display->screen, impl->outputs->data); if (refresh_rate != 0) timings->refresh_interval = G_GINT64_CONSTANT(1000000000) / refresh_rate; Where the 'refresh_rate' given is exactly what's come off the wire. 1000000000/60000 comes out as 16667, whereas divided by 60 is ... substantially less. https://bugzilla.gnome.org/show_bug.cgi?id=758653
* launcher: Fix drm device detection for non pci devicesAlban Browaeys2015-11-121-11/+17
| | | | | | | | On Odroid U2 (exynos4412) the drm device is not bound to pci. Open the detection to platform device of the drm subsystem, exclusive of control devices. https://bugzilla.gnome.org/show_bug.cgi?id=754911
* meta-backend: include stdlib.hRay Strode2015-11-061-0/+2
| | | | | Otherwise build fails with missing declaration warning for exit().
* Exit, not abort, when we fail to initialize ClutterOwen W. Taylor2015-11-061-1/+4
| | | | | | | | | Failing to initialize Clutter isn't something it's useful to report into automatic bug tracking systems or get a backtrace for - in fact, the most common case is that DISPLAY is unset or points to a non-existent X server. So simply exit rather than calling g_error(). https://bugzilla.gnome.org/show_bug.cgi?id=757311
* MetaLauncher: Don't g_error() on failureOwen W. Taylor2015-11-063-55/+109
| | | | | | | | | | | g_error() is the wrong thing to do when, for example, we can't find the DRM device, since Mutter should just fail to start rather than reporting a bug into automatic bug tracking systems. Rather than trying to decipher which errors are "expected" and which not, just make all failure paths in meta_launcher_new() return a GError out to the caller - which we make exit(1). https://bugzilla.gnome.org/show_bug.cgi?id=757311
* Revert "Force cursor update after applying configuration"Ray Strode2015-11-062-75/+0
| | | | | | This reverts commit 33150569cd9880af04be2ae3ab379578ff88312d. This was a stow-a-away sitting in my local tree.
* Force cursor update after applying configurationRay Strode2015-11-062-0/+75
| | | | | | | | | | | | The qxl kms driver has a bug where the cursor gets hidden implicitly after a drmModeSetCrtc call. This commit works around the bug by forcing a drmModeSetCursor2 call after the drmModeSetCrtc calls. This is pretty hacky and won't ever go upstream. https://bugzilla.gnome.org/show_bug.cgi?id=746078
* monitor-manager-xrandr: Skip outputs with no crtcsRui Matos2015-10-301-25/+38
| | | | | | | Outputs with no crtcs shouldn't happen, but if it does we should ignore them, instead of possibly crashing later. https://bugzilla.gnome.org/show_bug.cgi?id=756796
* monitor-manager-xrandr: Skip outputs with no modesRui Matos2015-10-301-2/+6
| | | | | | | | If we can't find any valid modes for an output we need to unwind and skip the output because trying to use a modeless output later will crash us. https://bugzilla.gnome.org/show_bug.cgi?id=756796
* Revert "monitor-manager-xrandr: Ignore outputs without modes"Rui Matos2015-10-301-9/+2
| | | | | | | This reverts commit 86a913d37aae4c96cb2e4d765b58fb4f60ec9d54. It introduced a memory leak, so we'll go for a cleaner approach. https://bugzilla.gnome.org/show_bug.cgi?id=756796
* monitor-manager: Expose a few helpers to clear structsRui Matos2015-10-302-22/+44
| | | | | | | These are useful for child classes to unwind cleanly when constructing their structures. https://bugzilla.gnome.org/show_bug.cgi?id=756796
* monitor-manager-xrandr: Ignore outputs without modesRui Matos2015-10-231-2/+9
| | | | | | | In some cases we get outputs without any valid mode. We need to ignore them or we'll crash later. https://bugzilla.gnome.org/show_bug.cgi?id=756796
* backend-x11: Ensure the Xkb group index remains properly setAlberts Muktupāvels2015-10-231-3/+13
| | | | | | | | | | | | | | | Ubuntu ships a patch in the X server that makes the group switch keybindings only work on key release, i.e. the X server internal group locking happens on key release which means that mutter gets the XKB_KEY_ISO_Next_Group key press event, does its XLockGroup() call with a new index and then, on key release, the X server moves the index further again. We can work around this without affecting our behavior in unpatched X servers by doing a XLockGroup() every time we're notified of the locked group changing if it doesn't match what we requested. https://bugzilla.gnome.org/show_bug.cgi?id=756543
* monitor-manager-xrandr: Be more robust when reading XRROutputInfosRui Matos2015-10-161-13/+29
| | | | | | | | | | | | | | We might get modes in XRROutputInfos that aren't in the XRRScreenResources we get earlier. This always seems to be transient, i.e. when it happens, the X server will usually send us a follow up RRScreenChangeNotify where we then get a "stable" view of the world again. In any case, when these glitches happen, we end up with NULL pointers in the MetaOutput->modes array which makes us crash later on. This patch ensures that doesn't happen. https://bugzilla.gnome.org/show_bug.cgi?id=756660
* backend-x11: Fallback to a default keymap if getting it from X failsRui Matos2015-09-251-0/+3
| | | | | | | | This shouldn't fail but apparently sometimes it does and in that case having a possibly wrong idea of the keymap is still better than crashing. https://bugzilla.gnome.org/show_bug.cgi?id=754979
* meta-monitor-manager: Remove bogus condition from checkFlorian Müllner2015-09-241-2/+1
| | | | | An unsigned number is never smaller than 0, so we don't have to check for it.
* Avoid shadowing existing variablesFlorian Müllner2015-09-246-41/+32
|
* Don't duplicate declarations from G_DEFINE_TYPEFlorian Müllner2015-09-243-6/+0
|
* Revert "launcher: simplify getting session dbus proxy"Jonas Ådahl2015-09-171-1/+10
| | | | | | | | | Signals are sent to a specific ID, so we can't use "self" here. After this revert, VT switching works again. This reverts commit 8e22bf5bc96a7d9ff1aba8ea8217a4c3ca06b4ce. https://bugzilla.gnome.org/show_bug.cgi?id=753434
* launcher: Don't pass variable as format stringFlorian Müllner2015-09-161-1/+1
| | | | | We know the variable only contains one or another string literal, but keep compilers happy as well.
* MetaCursorRenderer: Rely on update_cursor for redrawingJonas Ådahl2015-09-131-1/+0
| | | | | | | | | | | | | Calling queue_redraw() in _force_update() is not needed because update_cursor() will do this when needed, i.e. when switching between hardware cursor and texture cursor, or when drawing with texture cursor. There is also no need to force _native_force_update() because update_cursor() will cover this as well when needed. When not changing cursor but only the gbm_bo, the "dirty" boolean on the gbm_bo will trigger a redraw. https://bugzilla.gnome.org/show_bug.cgi?id=744932
* Support scaling of cursor sprites given what output they are onJonas Ådahl2015-09-139-197/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commits refactors cursor handling code and plugs in logic so that cursor sprites changes appearance as it moves across the screen. Renderers are adapted to handle the necessary functionality. The logic for changing the cursor sprite appearance is done outside of MetaCursorSprite, and actually where depends on what type of cursor it is. In mutter we now have two types of cursors that may have their appearance changed: - Themed cursors (aka root cursors) - wl_surface cursors Themed cursors are created by MetaScreen and when created, when applicable(*), it will extend the cursor via connecting to a signal which is emitted everytime the cursor is moved. The signal handler will calculate the expected scale given the monitor it is on and reload the theme in a correct size when needed. wl_surface cursors are created when a wl_surface is assigned the "cursor" role, i.e. when a client calls wl_pointer.set_cursor. A cursor role object is created which is connected to the cursor object by the position signal, and will set a correct texture scale given what monitor the cursor is on and what scale the wl_surface's active buffer is in. It will also push new buffers to the same to the cursor object when new ones are committed to the surface. This commit also makes texture loading lazy, since the renderer doesn't calculate a rectangle when the cursor position changes. The native backend is refactored to be triple-buffered; see the comment in meta-cursor-renderer-native.c for further explanations. * when we are running as a Wayland compositor https://bugzilla.gnome.org/show_bug.cgi?id=744932
* MetaCursorSprite: Squash MetaCurorImage into MetaCursorSpriteJonas Ådahl2015-09-131-40/+30
| | | | | | | It fills little purpose on separating into a MetaCursorImage struct, so lets squash in the three fields into the MetaCursorSprite object. https://bugzilla.gnome.org/show_bug.cgi?id=744932
* backends/x11: Draw our own cursor sprite when running nestedJonas Ådahl2015-09-133-1/+141
| | | | | | | | | Use a specialized cursor renderer when running as a nested Wayand compositor. This new renderer sets an empty X11 cursor and draws the cursor as part of the stage using the generic cursor renderer drawing path. https://bugzilla.gnome.org/show_bug.cgi?id=744932
* build: Fix non-wayland buildTing-Wei Lan2015-09-081-1/+7
| | | | | | | | This fixes build error caused by commit 614d6bd. We can simply remove the usage of meta-wayland.c functions in non-wayland build because META_BACKEND_X11_MODE_NESTED is only used in wayland. https://bugzilla.gnome.org/show_bug.cgi?id=753948
* launcher: find the right drm deviceMarek Chalupa2015-09-071-4/+104
| | | | | | | | Instead of hard-coding /dev/dri/card0, find the device that has boot_vga flag set or has been explicitly assigned a seat id other than seat0 https://bugzilla.gnome.org/show_bug.cgi?id=753434
* launcher: refactor handling errors in meta_launcher_newMarek Chalupa2015-09-071-29/+36
| | | | | | | | | | | Fill in missing error checks and use g_error, since any error in this phase would lead to crash later anyway. This way we'll at least know what went wrong. Although it was not the patch's original intention, it fixes https://bugzilla.gnome.org/show_bug.cgi?id=754520 https://bugzilla.gnome.org/show_bug.cgi?id=753434
* launcher: simplify getting session dbus proxyMarek Chalupa2015-09-071-11/+1
| | | | | | | Use path "/org/freedesktop/login1/session/self" instead of getting session id and building the path manually https://bugzilla.gnome.org/show_bug.cgi?id=753434
* native: remove obsolete commentMarek Chalupa2015-09-071-2/+0
| | | | | | There's not weston-launch anymore https://bugzilla.gnome.org/show_bug.cgi?id=753434
* Nested X11: use KeymapNotify events to fix key state on FocusInOwen W. Taylor2015-09-031-0/+30
| | | | | | | | | | | | | If the user Alt-Tabs out of the window, we will be left thinking the Alt key is still pressed since we don't see a release for it. Solve this and other related issues for the nested X11 compositor by selecting for KeymapStateMask which causes a KeymapNotify event to be sent after each FocusIn, and when we get these events, update the internal XKB state and send any necessary modifiers events to clients. https://bugzilla.gnome.org/show_bug.cgi?id=753948