Commit graph

205 commits

Author SHA1 Message Date
Consolatis
296e58079f Prepare OSD for reimplementation of the preview feature 2022-08-28 20:40:29 +02:00
John Lindgren
b7c4ba825a view/ssd: Refactor and fix visual indication for active windows
Partially fixes #494.

Co-Authored-by: Consolatis
2022-08-27 06:58:20 +01:00
Consolatis
36b2a93a69 Disconnect view from destroying output
Fixes #497

Reported-by @Flrian
2022-08-24 20:24:19 +01:00
Consolatis
b39020213a src/osd.c: Add preview outlines 2022-08-20 22:40:31 +01:00
Johan Malm
52d1e32b59 view: view_move() s/double/int/ for x and y 2022-08-18 19:50:25 +01:00
Consolatis
921c877f79 src/cursor.c: Keep sending motion events for out-of-layer-surface
Previously, motion events for a cursor which had been pressed on a surface
and then moved out of the surface were only sent for XDG and X11 surfaces.

This patch includes layer surfaces as well.

Fixes #483
2022-08-16 19:31:16 +01:00
John Lindgren
5d0faa2333 xwayland: Process unmanaged client configure requests more quickly
This is a similar fix to 065c37d3f5 but for unmanaged windows.  The issue
could be seen for example when moving the undocked Search Tool window in
Audacious.  For unmanaged windows, we don't track any pending move/resizes,
so just process all client configure requests immediately.
2022-07-23 20:37:59 +02:00
Consolatis
819404c43b xwayland: (Re)set seat when xwayland is ready
For some reason wlroots will reset the seat assigned to xwayland
to NULL whenever Xwayland terminates. This patch restores the seat
whenever Xwayland is ready again.

Fixes #166
Fixes #444

Thanks @droc12345 for figuring out the actual issue.
2022-07-21 03:57:42 +02:00
John Lindgren
065c37d3f5 xwayland: Process move-only client configure requests more quickly
For a move-only client configure request, treat it similarly to
view_move() by updating the scene-graph immediately, rather than waiting
for handle_commit().  Move-and-resize requests are handled the same as
before.

This (mostly?) fixes the glitchiness that was noticeable when dragging
an undecorated XWayland window (e.g. Audacious in Winamp mode).

Also:

- Reduce some code duplication in handle_request_configure() by
  simply calling configure(), as suggested by @johanmalm in #428.
- Factor out common logic after a move and/or resize into view_moved().
2022-07-18 22:06:12 +01:00
John Lindgren
80792d446f (Partly) fix handling of client-initiated configure requests
- Add missing call to wlr_scene_node_set_position() in
  unmanaged_handle_commit() -- this fixes moving unmanaged XWayland
  windows.

- Update view->pending_move_resize when we receive a configure request
  for a managed XWayland surface -- this fixes moving managed but
  undecorated XWayland windows.

- Also update view->pending_move_resize when we move a surface while a
  configure request is already pending -- this fixes a discrepancy
  between displayed and actual position for XWayland windows that try to
  set their own initial position, but then get overridden by labwc's
  positioning.

Moving undecorated XWayland windows is still really glitchy -- it appears
that an XWayland window gets sent incorrect mouse motion coordinates when
there is a pending configure request moving the window itself.
2022-07-03 12:59:36 +01:00
Consolatis
5585977f72 Rename unmaximized_geometry to natural_geometry 2022-07-02 16:21:32 +01:00
Consolatis
3a4b55886d src/view.c: Convert SnapToEdge to use view_apply_xxx_geometry framework 2022-07-02 12:43:23 +01:00
Consolatis
f4aa6118e9 src/layers.c: Adjust views based on usable_area changes 2022-06-30 20:41:54 +01:00
Consus
ca56357b5f workspaces: Allow switching/sending to the last used workspace
Actions GoToDesktop and SendToDesktop now support the new direction
called "last" that corresponds to the last used workspace (see Openbox
help[1] for reference).

[1]: http://openbox.org/wiki/Help:Actions#GoToDesktop
2022-06-18 18:34:58 +02:00
Joshua Ashton
505b1edb98 Allow leasing desktop displays
Apps such as Gamescope eventually want to offer a DRM lease option to use planes and handle all of getting to the screen themselves.

This implements logic to allow leasing of desktop displays
2022-06-16 20:42:17 +01:00
Consolatis
d557623c34 workspaces: Add workspaces.{c,h} 2022-06-15 22:26:21 +02:00
Consolatis
37ca5c28c1 include/labwc.h desktop_cycle_view: Clarify signature 2022-06-15 16:14:02 +01:00
Consolatis
a0d1003f28 src/keyboard.c: Make any_modifier_pressed() global 2022-06-15 16:14:02 +01:00
Johan Malm
9dcabbcfdd xwayland-unmanaged: prepare for handling more events
Sway handles some xwayland events that labwc still does not. This commit
just starts to rig up some handlers for these with log messages if they
are caught.

  - set_geometry: try to handle, but cannot find an application that uses
    it, so is untested.
  - request_activate - just log caught event
  - override_redirect - just log caught event
2022-06-05 09:45:58 +01:00
Consolatis
6dd290afc9 src/cursor.c: Fix branch condition for out-of-view selecting/dragging
Instead of using the stored view for comparison use the actual surface.

Before this patch, there were situations where the branch intended for
out-of-window text selection / scrollbar dragging was used even though
the cursor never left the surface.

Partly fixes #340
2022-05-24 17:35:32 +01:00
Johan Malm
81f216b6a2 xwayland: handle set_override_redirect events
This is needed to allow X11 applications to create surfaces as
non-override_redirect and then change them to override_redirect later

Without this gitk-menus and rofi are treated as xwayland-views with
associated server-side-decoration and forced positioning.
2022-05-03 20:45:30 +01:00
01micko
cbed8acf01 nls: add native language support
- adds labwc.pot and po files for de, es, it and sv
- added notes in NEWS.md and CONTRIBUTING.md
- addresses #269
- conditional upon `msgfmt` being installed
- can be disabled at build time
2022-05-02 10:33:42 +01:00
Consolatis
73930f7e0f view: Refactor view destruction some more 2022-04-23 08:59:06 +01:00
Joshua Ashton
d0b9680d00 view: Refactor view destruction
Consolidates all of the view destruction code for xwl + xdg into one function.

Fixes several notable bugs along the way:
  - Fixes a crash when alt tabbing when a selected view gets destroyed.
  - Fixes the OSD not updating to reflect a view has been destroyed.
2022-04-22 01:58:52 +02:00
Johan Malm
b27955050f xdg-shell: remove view->padding
With the wlroots scene-graph API, the padding variable is no longer
needed for windows with Client Side Decoration (CSD).
2022-04-21 20:21:36 +01:00
Johan Malm
48c9e6fda0 osd: show alt-tab switcher center-aligned on all outputs
Fixes issue #283
2022-04-20 17:45:10 +01:00
Consolatis
6b4d9b9383 Add ToggleAlwaysOnTop action 2022-04-09 17:18:39 +01:00
Johan Malm
5b34c81768 Fix trivial coding style breaches 2022-04-04 20:53:36 +01:00
John Lindgren
8e1f115486 cursor: Fix "jumping opposite edges" issue when resizing
Commit 08c537e ("xwayland: Honor size increments from
WM_SIZE_HINTS") adjusted only the window width/height according
to the size hints.  If resizing from the top or left edge of the
window, we also need to adjust the window position to keep the
bottom or right edge from jumping around.
2022-04-04 17:28:52 +01:00
Joshua Ashton
57a937bdf2 output: Implement drm_lease_v1
Needed for VR to work properly.
2022-03-28 21:13:51 +01:00
bi4k8
4c3bae0794 implement touch support
this is mostly plumbing; the most interesting logic is in touch_get_coords
2022-03-21 21:06:41 +00:00
Consolatis
64f7b9dd2b Restore Drag mouse bindings and proper double click
Fixes #258 and #259

Reported-by: @ahmadraniri1994
Reported-by: @01micko
Suggested-by: bi4k8 <bi4k8@github>
2022-03-21 18:08:04 +00:00
Johan Malm
97846ae45b cursor: add cursor_update_focus()
...and call it from desktop_move_to_front() in order force an enter event
on the surface below the cursor when cycling views.

Fixes #162 and #225
Inspired by PR #164 - just restructured it a bit.

Suggested-by: @bi4k8
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2022-03-21 17:57:20 +00:00
Consolatis
befe66d93f cursor.c: Keep sending adjusted motion events while button is pressed
This allows to keep dragging a scrollbar or selecting text even when
moving outside of the window. Fixes #241
2022-03-21 17:56:48 +00:00
bi4k8
c23397f362 support wlr-output-power-management 2022-03-08 20:07:51 +00:00
Johan Malm
6fd400b493 layers: put popups in separate node-tree
This allows popups to be rendered above views and other layers. Without
this, the popups of a layer-shell application in the bottom layer would
render below views, which does not seem right. For example, consider the
case of a panel with right-click popups.
2022-03-03 17:56:38 +00:00
Johan Malm
d3918eec0a layers: only define LAB_NR_LAYERS locally where needed 2022-03-02 20:39:46 +00:00
Johan Malm
98d5fd483d layers: s/arrange_layers/layers_arrange/
Because we like to start public function names with the name of the
file.

Move prototype from labwc.h to layers.h
2022-03-02 20:29:29 +00:00
Johan Malm
bd9ac3478a Remove src/damage.c 2022-03-01 20:54:52 +00:00
Consolatis
5f62f2ba99 xwayland.c: Fix positioning with multiple queued configure events
Prevents a single action like ToggleDecorations + ToggleMaximize to
position the view somewhere with negative coordinates when unmaximizing.

It may still position the view on negative coordinates but later commit
events will fix the position. This issue only exists on xwayland because
there are no configure serials which we could use to ignore all
repositioning until we are at the latest desired state.
2022-02-25 21:51:40 +00:00
Consolatis
a2523081e2 Handle 'lost' unmanaged xsurfaces + improve cursor handling 2022-02-23 21:47:01 +00:00
Consolatis
5862b65f89 Convert SSD to scene nodes 2022-02-23 21:47:01 +00:00
Consolatis
f2d40a8d69 Scene Menu 2022-02-23 21:47:01 +00:00
Consolatis
7ea733761b Use view->scene_tree as toplevel for view + some legwork:
desktop.c move_to_front() calls wlr_scene_node_raise_to_top
desktop.c, ssd/include.h add LAB_SSD_{OSD, MENU, LAYER_SURFACE} enums
desktop.c desktop_surface_and_view_at() -> desktop_node_and_view_at()
cursor.c reenable cursor_rebase()
cursor.c reenable button click on layer surface
2022-02-23 21:47:01 +00:00
Johan Malm
688abf7db1 Handle layers under the scene-graph API
This excludes popups.
2022-02-23 21:47:01 +00:00
Johan Malm
b79744e7b0 Chase wlroots master
We need it for wlr_scene_layer_surface_v1_create()
2022-02-23 21:47:01 +00:00
Johan Malm
5934ed6682 Add debug_dump_scene()
Dump view_tree and osd_tree on calling debug-action. Example bind:

<keybind key="A-F12">
  <action name="Debug"></action>
</keybind>
2022-02-23 21:47:01 +00:00
Johan Malm
532656ad5b Use wlroots scene-graph API
Move xdg-shell and xwayland-shell surfaces to new API

Also render alt-tab on-screen-display by converting cairo-surface to
wlr_buffer
2022-02-23 21:46:48 +00:00
ARDiDo
7c437eac2f OSD: Use separate OSD texture for each output 2022-02-09 21:57:32 +00:00
ARDiDo
049b84409e OSD: Scale OSD to the largest output scale 2022-02-09 21:57:32 +00:00