Commit graph

164 commits

Author SHA1 Message Date
Johan Malm
d34efad7bb view: remove warning in view_move_resize() 2022-03-07 20:59:54 +00:00
Johan Malm
bd9ac3478a Remove src/damage.c 2022-03-01 20:54:52 +00:00
Johan Malm
f4c9d1ba9f Set node position in xdg/xwayland commit handlers
...in order to sync resize/move events to avoid left/bottom edge wobbling
when resizing with top/left resize edges
2022-02-23 22:39:57 +00:00
Consolatis
5862b65f89 Convert SSD to scene nodes 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
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
John Lindgren
e0264e471c view: Handle maximized view on disabled output more simply
Partially reverts commit ab07b68d7e.
2022-01-08 17:23:57 +00:00
Johan Malm
ab07b68d7e view: adjust views safety following layout change
Refactor view_adjust_for_layout_change() in order to:

- Use view_maximize() - otherwise the unmaximized geometry remains off
  the screen.
- Avoid relying on view_apply_maximized_geometry() to handle missing
  output

Issue #194
2022-01-07 22:01:44 +00:00
Johan Malm
be89478f7a view: fix bug in view_snap_to_edge()
Use view_move() and view_move_resize() correctly.

view_move_resize() should only be used when the view actually changes
width and/or height, otherwise the serials might cause a delay in moving
xdg-shell clients.

Issue #201
2022-01-07 20:53:48 +00:00
ARDiDo
70845643af fullscreen: ignore decorations and maximize requests while fullscreen 2022-01-02 10:19:48 -05:00
ARDiDo
0f9374c701 decorations: use view_apply_maximized_geometry instead of view_maximize 2022-01-01 11:50:35 -05:00
John Lindgren
a837fefc80 Adjust views to account for output layout changes
labwc currently doesn't handle output layout changes very well:

 - Windows can end up "lost" completely offscreen
 - Maximized/fullscreen windows can end up spanning multiple outputs

Currently, new_output_notify() and output_destroy_notify() contain logic
to update the cursor and force a repaint when outputs are added or
removed.  This logic in fact needs to run on any output layout change,
so consolidate it into a new function, output_update_for_layout_change().

Then add a second new function, view_adjust_for_layout_change(), which
adjusts window placement to account for the new layout.

The behavior is roughly as follows:

 - Normal windows that end up offscreen are centered on the closest
   output (making use of the existing view_center() logic)
 - Maximized windows are re-maximized on the closest output.  Logic is
   also added to the unmaximize step to check that the original
   unmaximized position is still on-screen.
 - Fullscreen windows are re-fullscreened on the same output if
   possible; otherwise they are un-fullscreened.

Minimized windows don't require any special handling.  Their placement
is adjusted just the same, but invisible to the user until they are
later unminimized.

There is some positioning glitch still with un-fullscreening a window
whose output has been disconnected/disabled; it can end up in an
unexpected position (but at least has the correct size and decoration).
I don't think this is due to a bug in my change per se, but perhaps the
change has exposed a bug elsewhere.

Fixes: #177
2022-01-01 16:20:13 +00:00
ARDiDo
cd50344fdb view.c: re-maximize views when toggling decorations 2021-12-31 17:18:51 +00:00
Consolatis
4b2a7a28c6 view:c Do not overwrite unmaximized dimensions on fullscreen
Before: window -> maximize -> fullscreen -> unfullscreen would reset pre maximized state
Now: window -> maximize -> fullscreen -> unfullscreen -> unmaximize works as expected
2021-12-28 10:14:40 -05:00
Consolatis
09949e6faf view.c: Remove 'activated' flag when minimizing a view
Before this change a window that had been minimized showed up with states Minimized and Activated.
For foreign-toplevel clients like taskbars that could mean to handle multiple windows at once
having a 'activated' state even though they were clearly minimized.
2021-12-28 09:50:21 -05:00
John Lindgren
2ce961a0bd Check the return value of wlr_output_layout_get() for NULL
wlr_output_layout_get() seems to return NULL for disabled outputs.

Fixes: #174
2021-12-24 21:08:32 +00:00
ARDiDo
fd09e26ac8 view.c: end interactive mode when maximizing a view 2021-12-23 12:22:46 -05:00
Consolatis
80f012602f Implement foreign toplevel close 2021-12-23 09:29:08 -05:00
Johan Malm
238062a859 desktop: rename functions to increase consistency
...from
- desktop_raise_view()
- desktop_move_view_to_end_of_cycle()

to
- desktop_move_to_front()
- desktop_move_to_back()
2021-12-06 21:23:49 +00:00
bi4k8
bb4c277e08 query passed prop, not 'title' 2021-12-06 15:22:17 -05:00
bi4k8
7b7178ebfa move windows to back of cycle when they are minimized 2021-12-06 09:59:06 -05:00
ARDiDo
c5b8688894 Title repainting: move call to damage_all_outputs() to view_update() 2021-11-27 14:35:27 -05:00
Johan Malm
b7c326ec6f view.c: fix coding style 2021-11-26 18:57:25 +00:00
ARDiDo
6f2f79b8d7 HiDPI: fix move_to_edge and snap_to_edge 2021-11-24 17:33:10 -05:00
ARDiDo
ed3d0cd523 HiDPI: fix osd placement and maximized scale 2021-11-24 17:33:10 -05:00
ARDiDo
6698ca7300 HiDPI: send enter and leave events to views when switching monitors 2021-11-24 17:33:10 -05:00
ARDiDo
1d92404108 HiDPI: send output_enter events to views when they open 2021-11-24 17:33:10 -05:00
ARDiDo
a54e0fb4b6 view: get the closest wlr_output in view_wlr_output() 2021-11-13 12:09:40 -05:00
ARDiDo
a24e17dea7 Improve expandibility 2021-10-26 21:15:13 +01:00
ARDiDo
e1c8b3c641 Partial screen_edge_strength 2021-10-26 21:15:13 +01:00
Joshua Ashton
89f09567f5 xdg-deco: Respect decoration requests properly
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-20 18:49:02 +01:00
ARDiDo
fffa912fd6 use closest wlr_output 2021-10-20 06:51:30 +01:00
ARDiDo
380b8b295a clean up view_available_wlr_output 2021-10-20 06:51:30 +01:00
ARDiDo
08286a607f improve view_output 2021-10-20 06:51:30 +01:00
Johan Malm
e7da5f21e9 view: fix build warning 2021-10-18 20:06:47 +01:00
Johan Malm
806fdb08bd view: add view_get_string_prop() 2021-10-18 20:01:10 +01:00
Johan Malm
40da2f34a5 view: check view->impl functions exist before using
Avoids segfault when using disappearing notification in Thunderbird
2021-10-18 19:35:41 +01:00
Joshua Ashton
22d10497ca view: Add 'center' option to SnapToEdge
Similar to fullscreen, but not a separate state, and with gaps.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-17 23:24:36 +01:00
Johan Malm
bd1e6f3728 view: set inter-view gap correctly in SnapToEdge
When arranging views side-by-side or above-below using SnapToEdge, the gap
between views should be rc.gap rather than 2x rc.gap
2021-10-17 22:23:00 +01:00
Joshua Ashton
8652f97887 view: Add view_min_size helper function
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-17 19:49:05 +01:00
Joshua Ashton
f12617deea action: Fix crash in move to edge
Fixes a crash in move to edge ( #77 ) when the centre of the window is out of any display regions.

Doesn't fix the expected behaviour that it would work, but much better than the whole compositor dying.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-17 12:21:49 +01:00
Joshua Ashton
8e3108c032 action: Add 'SnapToEdge'
Implements snap-style edge snapping that works between multiple monitors.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-17 12:19:35 +01:00
Johan Malm
e2ae63a7cf xdg/wayland-shell: handle set_app_id and set_class events 2021-10-16 21:50:56 +01:00
Johan Malm
70144ac113 view: add view_set_activated()
Call wlr_foreign_toplevel_handle_v1_set_activated() from it in support of
issue #73
2021-10-16 19:24:26 +01:00
Johan Malm
ebb632419b *.c: add SPDX-License-Identifier 2021-09-24 21:45:48 +01:00
bi4k8
b7cce58f56 implement ToggleDecorations and ToggleFullscreen actions 2021-09-20 21:14:24 +01:00
Johan Malm
ea3ea49783 Fix more coding style violations 2021-08-25 20:45:39 +01:00
Johan Malm
7bfe350f25 view: fix impl->set_fullscreen() argument bug 2021-08-24 21:53:20 +01:00
Johan Malm
645a8e46a6 Support fullscreen mode (issue #53) 2021-08-23 22:05:30 +01:00
Johan Malm
0aee42473b view: update title width when resizing view 2021-08-22 14:35:34 +01:00