Commit graph

125 commits

Author SHA1 Message Date
bi4k8
3a29e436e5 fix crash when a minimized window closes
e.g., open an editor from a terminal, minimize it, then hit ^C in the terminal

simply don't unmap xdg or xwayland views if they are not currently marked as mapped
2021-12-12 19:03:03 -05:00
Joshua Ashton
3e973c92ab interactive: Fix crash if a window is destroyed while moving it
Need to clean this up if it's our grabbed window!

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-12-03 18:11:31 +00:00
ARDiDo
c5b8688894 Title repainting: move call to damage_all_outputs() to view_update() 2021-11-27 14:35:27 -05:00
John Lindgren
1bd26d259a Force repaint after window title changes
When a window title changed dynamically (for example when running
"cd" within an xfce4-terminal), the titlebar did not immediately
update to show the new title.  (The titlebar would update as soon
as the mouse cursor moved.)
2021-11-27 14:20:37 -05:00
Johan Malm
bca57213a0 Remove min/max macros
...and replace with a local MAX macro, because:

- They contain a ({}) construct which is a GNU extension and that's
  against Drew's coding style
- min() is not used anyway
- MAX() clashes with cairo's macro, so best to not add this in labwc.h
2021-11-26 19:16:00 +00: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
Dima Krasner
04450b5e4d build: fix name collision with wlroots, when linking statically 2021-11-08 19:10:37 +00:00
Joshua Ashton
60547cffe6 xdg: Set view in user data
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-20 18:49:02 +01:00
Joshua Ashton
140c245880 xdg: Respect min/max size in configure
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-17 19:49:05 +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
e140682528 view: call wlr_foreign_toplevel_handle_v1_set_app_id() on map
Fix issue #74

Add view-impl.c with view_impl_map() containing common code for xdg-shell
and xwayland-shell.
2021-10-16 21:26:57 +01:00
Johan Malm
9a290feeea desktop: simplify interface for view raise/focus
Split desktop_focus_view() into the following two functions:
  - desktop_focus_and_activate_view()
  - desktop_raise_view()

Always call view_set_activated() rather than using the private
set_activated(). This keeps the code cleaner and ensures
wlr_foreign_toplevel_handle_v1_set_activated() is called.
2021-10-16 19:44:54 +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
ARDiDo
6b9d3f4083 fix build errors 2021-10-03 21:50:29 +01:00
Johan Malm
ebb632419b *.c: add SPDX-License-Identifier 2021-09-24 21:45:48 +01:00
Johan Malm
cce3c8cda0 src/: fix coding style 2021-09-21 22:05:56 +01:00
Johan Malm
d11643bea5 xdg: chase wlr_xdg_toplevel refactor (issue #64) 2021-09-21 21:20:58 +01:00
gituser
3d15444b3a xdg: updates from wlroots master 2021-09-12 13:28:44 +01:00
Johan Malm
645a8e46a6 Support fullscreen mode (issue #53) 2021-08-23 22:05:30 +01:00
Johan Malm
8c96c65018 ssd: refactor in preparation for making ssd_visible_box() private
Prepare to move code from output/render functions to ssd. We want
rendering functions to just render, not calculate decoration geometry
and such like.
2021-08-22 14:12:05 +01:00
Johan Malm
77ade08158 osd: support 'alt-tab' on screen display
The osd window shows title, app_id/class and shell of all views that can
be cycled between.
2021-08-16 07:16:56 +01:00
Johan Malm
042ea266a5 Add simple foreign toplevel implementation 2021-08-05 12:18:10 +01:00
Johan Malm
22f5073ebd xdg: use "usable_area" when positioning view 2021-07-21 22:04:54 +01:00
Johan Malm
69f0f68cc2 Open new views on output where cursor is 2021-07-13 21:50:02 +01:00
Johan Malm
3034da776b xdg-shell: center view on first map
...and take into account output layout co-ordinates.

Previously xdg-shell views were just positioned at (0, 0) on first map
regardless of output co-ordinates.

Fix issue #39
2021-07-09 21:43:27 +01:00
Jan Beich
874cc9e637 xdg: chase swaywm/wlroots@9e58301df7
src/xdg.c:269:48: error: no member named 'subsurfaces' in 'struct wlr_surface'
                wl_list_for_each(subsurface, &view->surface->subsurfaces,
                                              ~~~~~~~~~~~~~  ^
/usr/include/wayland-util.h:443:30: note: expanded from macro 'wl_list_for_each'
        for (pos = wl_container_of((head)->next, pos, member);  \
                                    ^~~~
/usr/include/wayland-util.h:409:32: note: expanded from macro 'wl_container_of'
        (__typeof__(sample))((char *)(ptr) -                            \
                                      ^~~

Based on 3162766eef
2021-06-03 19:27:33 +01:00
Johan Malm
985ffd3691 xdg: fix subsurface damage bug
Create struct view_child for each wlr_surface subsurface on first view
map. Firefox doesn't damage properly without this.
2021-04-15 20:37:57 +01:00
Johan Malm
2a48f2801b Create a linked list of SSD for each view 2021-03-21 21:46:16 +00:00
Johan Malm
fc76100fd5 Add ssd.h 2021-03-21 20:54:55 +00:00
Johan Malm
a262b729df Rename deco.c ssd.c 2021-03-20 14:41:39 +00:00
Johan Malm
04d2ae39a9 xdg: improve positioning of new xdg-toplevel views
Top/left align topmost parent.
Center-align children relative to parent.
2021-03-20 14:30:45 +00:00
Johan Malm
d839889972 xdg: start unmaximized
Some xdg-shell applications remember the (un)maximized states when last
closed. We could honour this state, but it makes the code cumbersome
regarding padding and position. Prefer to keep it simple.
2021-03-17 20:56:03 +00:00
Jan Beich
ad07acc13c xdg: chase swaywm/wlroots@f574ca934c
src/xdg.c:180:2: warning: implicit declaration of function 'wlr_xdg_surface_for_each_popup' is invalid in C99 [-Wimplicit-function-declaration]
        wlr_xdg_surface_for_each_popup(view->xdg_surface, iterator, data);
        ^
ld: error: undefined symbol: wlr_xdg_surface_for_each_popup
>>> referenced by xdg.c:180 (src/xdg.c:180)
>>>               labwc.p/src_xdg.c.o:(xdg_toplevel_view_for_each_popup)

Based on 5438cc158a
2021-03-13 23:23:33 +00:00
Johan Malm
b8c6f9c216 xdg: update padding on commit
Maximize/unmaximize changes padding on XDG-shell views with CSD, so we
need to update padding to render cycle-view decoration correctly.
2021-03-12 21:23:46 +00:00
Johan Malm
c1269adc40 xdg: on init, set maximize according to wlr_xdg_surface status 2021-03-08 21:56:57 +00:00
Johan Malm
9760a8157f Create xdg-deco.c 2021-03-02 20:53:03 +00:00
Johan Malm
d54a998dd8 Handle wlr_surface->events.new_subsurface
Add view-child.c, xdg-popup.c, subsurface.c in order to track damage
associated with new XDG subsurfaces.
2021-03-02 20:37:23 +00:00
Alex Bryan
f5f8acc543 Merge branch 'maximize' 2021-02-27 17:14:24 -05:00
Alex Bryan
5e7f2c91a3 Added basic maximize support for xdg and xwayland 2021-02-27 17:10:53 -05:00
Johan Malm
133ea96f64 Simplify view margin/padding related code
Fix xdg-shell CSD resize bug
2021-02-27 16:55:10 +00:00
Johan Malm
011f20ef6b xdg.c: damage outside view for popups 2021-02-17 20:42:50 +00:00
Johan Malm
54804fd3df Implement damage tracking 2021-01-09 22:51:20 +00:00
Johan Malm
cb44f047f3 Add view_move() 2020-12-23 18:52:46 +00:00
Johan Malm
7c29bcb45e xdg-shell: await configure serial before moving (issue #11) 2020-12-22 21:08:17 +00:00
Johan Malm
e0770a5672 Refactor view_move_resize() 2020-12-22 20:35:06 +00:00
Johan Malm
5f9c5a9d01 desktop: refactor desktop_focus_topmost_mapped_view()
Rename from desktop_focus_next_mapped_view() to
desktop_focus_topmost_mapped_view() and only take struct server as
argument.
2020-10-31 14:32:31 +00:00
Johan Malm
d5b9a65978 s/cursor_mode/input_mode/ 2020-10-21 20:30:06 +01:00
Johan Malm
f752610e0b desktop: refactor desktop_focus_view() 2020-10-08 20:08:41 +01:00
Johan Malm
aa0b2b8e9e xdg-shell: add wlr_xdg_surface_ping() 2020-10-08 19:58:47 +01:00