Commit graph

309 commits

Author SHA1 Message Date
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
Johan Malm
edc5338af4 Add command line option -C to specify config directory
Also expand usage message to explain what each option means
2022-04-22 17:00:36 +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
Consolatis
3171aba0e2 ssd: dynamically adjust resize extents based on usable_area
Fixes #265
2022-03-12 15:32:44 +00:00
Consolatis
e4f1f9a975 ssd: use dynamic titlebar height based on font size and padding 2022-03-12 15:32:44 +00:00
bi4k8
c23397f362 support wlr-output-power-management 2022-03-08 20:07:51 +00:00
Johan Malm
6b8c10dcd4 view: show fullscreen views above top-layer
See https://github.com/LBCrion/sfwbar/issues/24
2022-03-07 21:20:44 +00:00
Johan Malm
852a6f02fa layers: fix layer_popup_tree implementation 2022-03-06 16:48:39 +00:00
Johan Malm
19f3a6ef83 output: attach node-descriptors to node-trees 2022-03-03 18:20:16 +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
Consolatis
8444ba4075 Convert menu to node_descriptors 2022-03-03 17:49:54 +00:00
Johan Malm
eb7645d0e0 node.c: use wlr_scene_node instead of node_descriptor 2022-03-02 22:24:30 +00:00
Johan Malm
b4cbc20e8c node.c: add helpers for returning structs from node data
Support returning the following structs:
  - view from LAB_NODE_DESC_VIEW or LAB_NODE_DESC_XDG_POPUP
  - lab_layer_surface form LAB_NODE_DESC_LAYER_SURFACE
  - lab_layer_popup from LAB_NODE_DESC_LAYER_POPUP
2022-03-02 22:05:41 +00:00
Johan Malm
30298228e3 Rename node-descriptor.c to node.c
...in anticipation of adding helpers like node_view_from_node()
2022-03-02 21:07:04 +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
Johan Malm
49e8658a7b layer: support popups 2022-02-26 22:36:16 +00:00
Johan Malm
2891ff245e Add node-descriptor for wlr_scene_nodes
Support identification of wlr_scene_node role to enable simplification
of codebase including the avoidance of iterating over lists of
layer-surface, menuitems, and so on.

Use node-descriptors for xdg toplevels and popups
2022-02-26 22:35:51 +00:00
Consolatis
4c981b845f include/ssd.h remove unnecessary struct definition
Instead, just tag the struct so we can reference it.
2022-02-25 21:52:10 +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
953e8a4f9d [style] rename action() to actions_run() 2022-02-24 21:17:51 +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
Johan Malm
f26b61137d layers.h: define LAB_NR_LAYERS (4) 2022-02-23 21:47:01 +00:00
Consolatis
044388a5cd Prepare to move from wlr_texture to lab_data_buffer 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
f22bfc96b2 buffer: create cairo_t inside buffer_create() 2022-02-23 21:47:01 +00:00
Johan Malm
ba909e4fc7 Refactor buffer implementation to take a cairo_t
Remove buffer_drop() and just destroy it.
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
Johan Malm
d2552232c7 Add buffer.c to cover cairo-surface to wlr_buffer 2022-02-23 21:41:01 +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
Consolatis
413811f3a2 Use proper enum argument type for desktop_surface_and_view_at 2022-01-30 21:23:15 +00:00