summaryrefslogtreecommitdiff
path: root/src/wayland
Commit message (Collapse)AuthorAgeFilesLines
* wayland/buffer: Add missing breaks in switch statementJonas Ådahl2017-08-161-0/+2
| | | | | | | We'd process damage, and no matter whether it succeeded or not we'd pretend it succeeded, meaning any potential GError would be leaked. https://bugzilla.gnome.org/show_bug.cgi?id=786300
* wayland: use the inhibit shortcuts dialogOlivier Fourdan2017-08-024-2/+206
| | | | | | | | | | Plug the new MetaInhbitShortcutsDialog to the relevant Wayland protocol implementation. Also, remember the last user choice for a given surface to avoid asking continuously the same question. https://bugzilla.gnome.org/show_bug.cgi?id=783342
* wayland: add keyboard shortcuts inhibitor protocolOlivier Fourdan2017-08-024-0/+225
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=783342
* wayland: add inhibit shortcut mechanismOlivier Fourdan2017-08-025-0/+121
| | | | | | | | | | | Add a mechanism to MetaWaylandSurface that inhibits compositor's own shortcuts when the surface has input focus, so that clients can receive all key events regardless of the compositor own shortcuts. This will help with implementing "fake" active grabs in Wayland and XWayland clients. https://bugzilla.gnome.org/show_bug.cgi?id=783342
* wayland: Add zwp_linux_dmabuf_v1 supportDaniel Stone2017-08-016-0/+664
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=785262 Signed-off-by: Daniel Stone <daniels@collabora.com>
* wayland: Reset tablet tool cursor surface on proximity outCarlos Garnacho2017-07-261-0/+1
| | | | | | | | | The cursor surface would be remembered until the next proximity in event, causing flashing of the old cursor till the client underneath the tablet tool sent the zwp_tablet_tool.set_cursor request. Forgetting about the cursor surface on proximity out makes the cursor invisible till the request is made.
* wayland: Update button state on motion/button eventsCarlos Garnacho2017-07-241-1/+6
| | | | | | | | More specifically, avoid crossing events, since clutter does not set modifier/button state on those. Fixes implicit grabs being broken when the pointer moves past the surface boundaries. https://bugzilla.gnome.org/show_bug.cgi?id=785347
* wayland/buffer: Create EGLImage with no contextDaniel Stone2017-07-221-2/+3
| | | | | | | | | | | | | | | | | Since a wl_buffer is independent of the GL context in use (unlike, e.g., a GL renderbuffer), EGLImages with the EGL_WAYLAND_BUFFER_WL target must pass EGL_NO_CONTEXT as the context. Quoting from the EGL_WL_bind_wayland_display spec: After querying the wl_buffer layout, create EGLImages for the planes by calling eglCreateImageKHR with wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL context. The check was already present inside _cogl_egl_create_image. https://bugzilla.gnome.org/show_bug.cgi?id=785263 Signed-off-by: Daniel Stone <daniels@collabora.com>
* wayland: Provide basic tablet wheel event supportJason Gerecke2017-07-171-2/+34
| | | | | | | | | | | | Adds basic support for the "wheel" event from the Wayland tablet protocol. Ideally we would accumulate the angle and report a wheel event with an appropriate value for "clicks". We can get away with a much cruder method for the time being, however, since no Wacom tablet puck actually provides a smooth scrollwheel. Checking whether the angle in CLUTTER_INPUT_AXIS_WHEEL exceeds a nominally-small threshold is sufficient to determine that the wheel has advanced by at least one physical click. https://bugzilla.gnome.org/show_bug.cgi?id=783716
* wayland/window: Update toplevel main monitor before non-toplevelJonas Ådahl2017-07-171-1/+3
| | | | | | | | | | | | When updating the main monitor, make sure to update the toplevel main monitor before trying to use that as the main monitor for non-toplevel windows (such as popups). Without this, when the main monitor is updated as a side effect to monitors being changed (for example due to a hot plug event, or coming back from being suspended) the main monitor pointer may, after 'monitors-changed' has completed, point to freed memory resulting in undefined behaviour. https://bugzilla.gnome.org/show_bug.cgi?id=784867
* cursor-renderer: Track cursor position using floatsJonas Ådahl2017-07-143-6/+10
| | | | | | | | | To be able to render the pointer cursor sprite at sub-(logical)-pixel positions, track the pointer position using floats instead of ints. This also requires users of the cursor sprite rect to deal with floating points, when e.g. finding the logical monitor etc. https://bugzilla.gnome.org/show_bug.cgi?id=765011
* Add support for rudimentary fractional scalingJonas Ådahl2017-07-141-2/+11
| | | | | | | | | | | | | When the logical layout mode is used, allow configuring the scaling to be non-integer. Supported scales are so far hard coded to include at most 1, 1.5 and 2, and scales that doesn't result in non-fractional logical monitor sizes are discarded. Wayland outputs are set to have scale ceil(actual_scale) meaning well behaving Wayland clients will provide buffers with buffer scale 2, thus being scaled down to the fractional scale. https://bugzilla.gnome.org/show_bug.cgi?id=765011
* logical-monitor: Make scale a floatJonas Ådahl2017-07-143-7/+12
| | | | | | | To support fractional scaling, the logical monitor scale must be stored as a float. No other functional changes is part of this commit. https://bugzilla.gnome.org/show_bug.cgi?id=765011
* wayland: Store and retrieve implicit grab information for tablet toolsJason Gerecke2017-07-134-19/+86
| | | | | | | | | Window moving and resizing depends on the `meta_wayland_seat_get_grab_info` function succeeding. At the moment, tablet tools do not generate implicit grabs like the pointer and touch. This commit adds the necessary elements to track implicit grabs and retrieve their information. https://bugzilla.gnome.org/show_bug.cgi?id=777333
* wayland: Random whitespace fixesJonas Ådahl2017-07-121-11/+16
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=784080
* wayland: Add support for wl_surface.damage_bufferJonas Ådahl2017-07-123-18/+62
| | | | | | | Implements support for the wl_surface.damage_buffer request, which damages the buffer using buffer coordinate space. https://bugzilla.gnome.org/show_bug.cgi?id=784080
* wayland: Base tablet tool coordinates on the current eventCarlos Garnacho2017-07-031-8/+5
| | | | | | | Instead of the last device position. This was copied a little bit too straight from MetaWaylandPointer. https://bugzilla.gnome.org/show_bug.cgi?id=783535
* wayland/pointer: Check for subsurfaces when grabbingmitchmindtree2017-06-071-1/+21
| | | | | | | | | Previously, the function only returned `TRUE` if the given surface was equal to the given pointer's focused surface. This changes the behaviour to also return `TRUE` if any of the given surface's subsurfaces are equal to the pointer's focused surface. https://bugzilla.gnome.org/show_bug.cgi?id=781811.
* wayland/pointer: Track lifetime of current surfaceJonas Ådahl2017-06-012-3/+46
| | | | | | Clear the pointer->current when the surface is destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=783113
* wayland/pointer: Use glib signals tracking focus surfaceJonas Ådahl2017-06-012-14/+16
| | | | | | | | | | | | | Use the "destroy" MetaWaylandSurface signal instead of the wl_resource destroy signal for tracking the lifetime of the surface with pointer focus. As unsetting the focus may have side effects due to handlers of the "focus-surface-changed" signal, connect the signal after the default handler to make sure other clean up facilities have the chance deal with the surface destruction before we try to unset the focus. https://bugzilla.gnome.org/show_bug.cgi?id=783113
* wayland: Ensure we repick the pointer on synthesized crossing eventsCarlos Garnacho2017-05-221-1/+16
| | | | | | | | | Relayouts in clutter may trigger synthesized crossing events if the actor below the pointer changes. In that situation we do need to repick() the MetaWaylandPointer to end up with the right current wayland surface. https://bugzilla.gnome.org/show_bug.cgi?id=755164
* wayland: Use notify::allocation to update pointer as per confinementsCarlos Garnacho2017-05-221-4/+5
| | | | | | | There is no need to constraint the pointer to the confinement on each redraw if the surface actor didn't move/resize. https://bugzilla.gnome.org/show_bug.cgi?id=782344
* wayland: Use notify::allocation notification to update surface outputsCarlos Garnacho2017-05-221-9/+16
| | | | | | Instead of updating the surface outputs on each actor ::paint. https://bugzilla.gnome.org/show_bug.cgi?id=782344
* wayland: place window if maximized before placementOlivier Fourdan2017-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | If a client changes the state of a surface to issue a set_maximize, this causes apply_pending_state() to be called before mutter has placed the window. If the monitor on which the window is to be shown initially is different from the one where the pointer is placed, this causes the effect to be played at the wrong location before the window eventually reaches its location on another monitor. Force the window to be placed prior to change its state to maximized in xdg-shell so that mutter won't relocate the window afterwards. This also avoids sending an xdg_toplevel.configure with a size of 0x0 which would cause the client to initially draw its surface with some arbitrary size. https://bugzilla.gnome.org/show_bug.cgi?id=782183 https://bugzilla.gnome.org/show_bug.cgi?id=781353
* xwayland: Use the right atom type for further selection requests to X11Carlos Garnacho2017-05-101-1/+1
| | | | | | | | | If we translate between text/plain;charset-utf-8 from the wayland side to UTF8_STRING on the X11 side, we want to continue all further X11 selection requests using the same translated UTF8_STRING atom than we use in the first XConvertSelection call. https://bugzilla.gnome.org/show_bug.cgi?id=782472
* wayland: Apply size hints regardless of geometryOlivier Fourdan2017-05-101-12/+10
| | | | | | | | | | | | Previously we would bail out early in xdg_toplevel_role_commit() if no geometry change was set, ignoring the possible min/max size hints changes. But setting a min/max size hint without changing the geometry is perfectly valid, so we ought to apply the min/max changes regardless of a geometry change. https://bugzilla.gnome.org/show_bug.cgi?id=782213
* wayland: Make sure we have a pending geometryOlivier Fourdan2017-05-101-1/+9
| | | | | | | | | | | | | If the client doesn't set a geometry using xdg_shell, we'll compute its geometry based on its surface and subsurfaces. Yet, we translate that as a window (re)size only when there is a pending geometry, that we don't have when we computed the geometry by ourself. Make sure we set the pending new geometry flag when computing the geometry when it actually changed. https://bugzilla.gnome.org/show_bug.cgi?id=782213
* wayland: Collect frame completion time once for all surfacesCarlos Garnacho2017-05-091-1/+3
| | | | | | | Dispatch all surface frames with the same monotonic time to avoid querying it too often. https://bugzilla.gnome.org/show_bug.cgi?id=782344
* wayland/subsurface: Handle clients committing on destroyed subsurfaceJonas Ådahl2017-04-211-1/+1
| | | | | | | | A client can still commit state to a destroyed subsurface. It wont update anything on the screen, since the subsurface will not be visible, but mutter should still handle it and not crash. https://bugzilla.gnome.org/show_bug.cgi?id=781391
* Add support for scaled logical monitor framebuffersJonas Ådahl2017-04-072-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for rendering onto enlarged per logical monitor framebuffers, using the scaled clutter stage views, for HiDPI enabled logical monitors. This works by scaling the mode of the monitors in a logical monitors by the scale, no longer relying on scaling the window actors and window geometry for making windows have the correct size on HiDPI monitors. It is disabled by default, as in automatically created configurations will still use the old mode. This is partly because Xwayland clients will not yet work good enough to make it feasible. To enable, add the 'scale-monitor-framebuffer' keyword to the org.gnome.mutter.experimental-features gsettings array. It is still possible to specify the mode via the new D-Bus API, which has been adapted. The adaptations to the D-Bus API means the caller need to be aware of how to position logical monitors on the stage grid. This depends on the 'layout-mode' property that is used (see the DisplayConfig D-Bus documentation). https://bugzilla.gnome.org/show_bug.cgi?id=777732
* window: Replace monitor scale getter with geometry scaleJonas Ådahl2017-04-073-37/+38
| | | | | | | All places that get the 'main monitor scale' of a window really just wants the window geometry scale, so call it that. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* wayland: Use clutter_input_device_is_grouped() for tablet groupingCarlos Garnacho2017-03-131-17/+2
| | | | | | Instead of poking the internal libinput device. https://bugzilla.gnome.org/show_bug.cgi?id=779986
* xwayland: Raise the dnd window each timeOlivier Fourdan2017-03-091-1/+1
| | | | | | | | | | | If the dnd window ends up lower in the overall stack than the window it's supposed to fence, the drop might end up in some other window underneath the expected target window. Maps and raises the dnd window each time it's shown so that it's always placed above. Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=779800
* xwayland: Use timestamp from XdndPosition/Drop on XConvertSelectionCarlos Garnacho2017-03-081-1/+6
| | | | | | | | QT apps reject DnD if the timestamp received in the SelectionRequest event isn't the same it gave in XdndPosition/Drop client messages. Bookkeeping and using it in XConvertSelection makes it happy again. https://bugzilla.gnome.org/show_bug.cgi?id=779757
* xwayland: Check MetaDndBridge focus_window when updating X11 proxy windowCarlos Garnacho2017-03-081-3/+3
| | | | | | | | | | | | | | We are keeping accounting of the focus window as seen by the DnD bridge right here, so use it instead of the MetaWaylandDragGrab focus as it may lag behind the real focus (i.e. till the drag source notices the window and sends XdndEnter to it). This leads to the window trying to be repositioned more often than necessary when the drag source takes long to send the XdndEnter client message, and maybe not repositioned at all if the pointer leaves the surface while no XdndEnter message was received. https://bugzilla.gnome.org/show_bug.cgi?id=763246
* xwayland: Release xdnd grabs ASAPCarlos Garnacho2017-03-081-3/+24
| | | | | | | | | | | | | | We currently wait for the selection being cleared by the drag source, which might not happen on not quite educated clients. This may leave a stuck XDND grab in the compositor side. We can actually do a bit better, and clear the grab if: 1) The drag source sent XdndDrop to the wayland drag destination. 2) There's no accepting drag destination and all pointer buttons are released. 3) As usual, whenever the drag source clears the selection data https://bugzilla.gnome.org/show_bug.cgi?id=763246
* dnd: Implement DnD handling code in WaylandHyungwon Hwang2017-03-072-0/+20
| | | | | | | | | No XDnD events which notify DnD status change comes in Wayland. To emulate XDnD behavior, MetaDnd checks whether there is a grab or not when the modal window starts showing. When there is a grab, it processes the raw events from compositor, and emits DnD signals for plugin. https://bugzilla.gnome.org/show_bug.cgi?id=765003
* wayland-xdg-shell: Handle the wl_output on the set_fullscreen requestRui Matos2017-02-211-0/+8
| | | | | | This makes us fullscreen wayland windows on the requested monitor. https://bugzilla.gnome.org/show_bug.cgi?id=772525
* wayland/keyboard: Avoid a division by zeroRui Matos2017-02-161-1/+5
| | | | | | | We don't further sanitize the values since the protocol allows for everything as long as it's non-negative. https://bugzilla.gnome.org/show_bug.cgi?id=776919
* wayland: Update tool cursor scale when crossing monitorsCarlos Garnacho2017-02-152-0/+25
| | | | | | This makes tool cursors properly scaled on hidpi. https://bugzilla.gnome.org/show_bug.cgi?id=778474
* wayland: Keep pointer to cursor sprite on MetaWaylandTabletToolCarlos Garnacho2017-02-152-1/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=778474
* wayland: Clean up MetaWaylandTabletPadGroupCarlos Garnacho2017-02-101-65/+10
| | | | | | | Using the clutter counterparts, some backend-specific code can be removed from here. https://bugzilla.gnome.org/show_bug.cgi?id=771098
* wayland: fix copy/pasto sending tool removed on rings/stripsPeter Hutterer2017-02-072-2/+0
| | | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> https://bugzilla.gnome.org/show_bug.cgi?id=778262
* wayland/output: Operate on monitors instead of outputsJonas Ådahl2017-01-251-24/+54
| | | | | | | | Operate on MetaMonitor's instead of MetaOutput's, as the latter may be only a subset of an actual "monitor" when referring to the physical computer equipment. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* wayland/output: Pass 'unknown' subpixel order when mismatchJonas Ådahl2017-01-251-1/+53
| | | | | | | | | When a logical monitor constains monitors with different subpixel ordering, make the wl_output have the subpixel order 'unknown' so that clients don't make assumptions given only a subset of the monitors of the given region. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* logical-monitor: Don't mirror refresh rateJonas Ådahl2017-01-252-3/+9
| | | | | | | Let the callers figure out how to associate a logical monitor with a refresh rate, instead of exposing an arbitrary one. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* logical-monitor: Don't mirror physical dimensionsJonas Ådahl2017-01-251-2/+2
| | | | | | | | Don't try to mirror the physical dimension, since that's a property of one of the monitors, not of the logical monitor. Callers are changed to deal with choosing the monitor to represent the logical monitor. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* logical-monitor: Don't duplicate output listJonas Ådahl2017-01-251-6/+26
| | | | | | Just use the monitor list and the output lists of each monitor. https://bugzilla.gnome.org/show_bug.cgi?id=777732
* monitor-manager: Move logical monitor into its own fileJonas Ådahl2017-01-254-0/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=777732
* wayland: Add API to override display nameJonas Ådahl2017-01-252-3/+26
| | | | | | | Add API that the tests can use in order to override the Wayland display name. https://bugzilla.gnome.org/show_bug.cgi?id=777732