Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to dwl v0.3.1 #25

Merged
merged 160 commits into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
84b26ef
Revert "fix README for main branch"
djpohly Apr 8, 2021
9071ce6
nuke CSDs, hopefully for good!
djpohly Apr 9, 2021
77e75cf
Merge branch 'main' into wlroots-next
djpohly Apr 9, 2021
b372d4b
pipe status info into -s command
djpohly Apr 14, 2021
6a0dec6
re-compile if config.mk changes
djpohly Apr 15, 2021
4170a90
group phony targets together in Makefile
djpohly Apr 15, 2021
3727f4a
update status info if focused client changes title
djpohly Apr 15, 2021
3f86336
Merge branch 'main' into pipe-status
djpohly Apr 15, 2021
d57db4c
added uninstall target
JaGoLi Apr 19, 2021
2f39fb8
Merge pull request #112 from JaGoLi/main
djpohly Apr 19, 2021
41bb7a7
Merge branch 'pipe-status'
djpohly May 10, 2021
1b139a8
update README
djpohly May 18, 2021
93a58ab
Wait until map to set window's tiled state
djpohly May 22, 2021
d8cf65c
implement urgency hint
djpohly May 23, 2021
ce9f264
Merge pull request #120 from djpohly/set-tiled-on-map
djpohly May 23, 2021
9ab5e01
before set tiled verify if client is xdg-shell, then set tile
sevz17 May 23, 2021
56d9389
Merge pull request #122 from Sevz17/set-tiled-on-map
djpohly May 23, 2021
06ca860
factor xwayland hackiness out into client.h
djpohly May 23, 2021
5dfd7cf
Merge branch 'main' into wlroots-next
djpohly May 25, 2021
60c40c0
print status on output create
djpohly May 25, 2021
823cefd
handle ephemeral pageflip failures
djpohly May 25, 2021
bd2f7fb
exit cleanly on INT/TERM
djpohly May 27, 2021
c6f96d5
mention `-devel` packages
djpohly Jun 3, 2021
34521ea
Merge branch 'main' into wlroots-next
djpohly Jun 3, 2021
d4ce92a
Merge branch 'xdg-activation' into wlroots-next
djpohly Jun 3, 2021
f9f3f34
Merge branch 'xdg-activation' into wlroots-next
djpohly Jun 3, 2021
3b05ead
update notes about starting dwl
djpohly Jun 30, 2021
52e6bf4
Moved printstatus() call in focusclient() to prevent printstatus bein…
drdonahue Jul 1, 2021
d175a58
implement the presentation time protocol
guidocella Aug 2, 2021
8aa50df
update IRC channel
guidocella Aug 3, 2021
3f70bbb
Merge pull request #130 from drdonahue/printstatus-fix
djpohly Aug 14, 2021
1183a31
Merge pull request #136 from guidocella/presentation-time
djpohly Aug 14, 2021
3273f74
wlr_layer_surface_v1_close has been replaced by wlr_layer_surface_v1_…
PalanixYT Aug 20, 2021
772c0fe
Merge pull request #145 from PalanixYT/wlroots-next
djpohly Aug 23, 2021
d4e08c0
update deprecated xkb function name
djpohly Aug 23, 2021
55bbbc3
Merge branch 'main' into wlroots-next
djpohly Aug 24, 2021
79dcc0d
reset cursor mode when grabc is unmapped
xi Sep 4, 2021
2e9c4d8
simplify client_for_each_surface
djpohly Sep 5, 2021
417e958
Merge branch 'main' into wlroots-next
djpohly Sep 5, 2021
0c1e621
simplify fullscreen expression
djpohly Sep 9, 2021
40e45a3
Merge branch 'main' into wlroots-next
djpohly Sep 9, 2021
929d3d9
use type enum to distinguish Client from LayerSurface
djpohly Sep 5, 2021
1b38801
use scene-graph API for Client/LayerSurface
djpohly Sep 5, 2021
be6f573
use scene to keep track of LayerSurfaces' layers
djpohly Sep 5, 2021
0146a99
use scene_output for damage-tracked rendering
djpohly Sep 6, 2021
c8bf457
fixup: follow name change on surface_tree_create
djpohly Sep 21, 2021
7de6920
send frame_done to all visible surfaces
djpohly Sep 21, 2021
1e1482a
client_pending has been renamed as pending in wlr_layer_surface_v1
sevz17 Sep 24, 2021
d3efb0b
Merge pull request #150 from Sevz17/wlroots-next
djpohly Sep 25, 2021
99fbebc
Remove redundant xcursor manager
Sep 27, 2021
96ce40c
Merge pull request #152 from ARDiDo/no_redundant_xcursor
djpohly Sep 27, 2021
df332de
send frame_done also to all layer surfaces
sevz17 Sep 24, 2021
2c9423d
`wlr_xdg_surface.configure_serial` has been moved into `wlr_xdg_surfa…
sevz17 Oct 4, 2021
2d9740c
document status information and <&- in README
djpohly Oct 6, 2021
ebfefa8
-s: close unused fds
Humm42 Oct 13, 2021
05ac420
Merge branch 'wlroots-next' into HEAD
sevz17 Oct 27, 2021
894f2a3
change border color according to focus state
sevz17 Oct 31, 2021
03e167d
fullscreennotify: don't crash if called before map
raphaelr Nov 13, 2021
c71a3ac
Merge branch 'wlroots-next' of github:djpohly/dwl into scenegraph3
djpohly Dec 16, 2021
2315462
Merge commit 'refs/pull/162/head' of github:djpohly/dwl into scenegraph3
djpohly Dec 16, 2021
852fe81
Merge branch 'wlroots-next' of github:djpohly/dwl into wlroots-next
djpohly Dec 16, 2021
52dbc97
`wlr_xdg_surface.configure_serial` has been moved into `wlr_xdg_surfa…
sevz17 Oct 4, 2021
27f66c8
explicitly create renderer and allocator
djpohly Dec 16, 2021
27514b9
Merge branch 'wlroots-next' into scenegraph3
djpohly Dec 16, 2021
09413da
Merge branch 'main' of github:djpohly/dwl
djpohly Dec 22, 2021
f85d8e7
Merge branch 'wlroots-next'
djpohly Dec 22, 2021
f4ae4c1
Merge branch 'main' into scenegraph3
djpohly Dec 22, 2021
317175d
Newly launched or closed clients ALWAYS generate status update
Dec 31, 2021
f587b2f
fix client_set_tiled, which was ignoring its "edges" argument
Armael Jan 8, 2022
ac896a7
Shift+6 generates XKB_KEY_asciicircum
Feb 2, 2022
bda7b31
Merge pull request #189 from fauxmight/shift-6-is-asciicircum
djpohly Feb 15, 2022
22a6f66
Merge pull request #151 from Sevz17/scenegraph3
djpohly Feb 15, 2022
b860932
Merge branch 'scenegraph3' of github:djpohly/dwl into scenegraph3
djpohly Feb 15, 2022
a15cb1e
Merge pull request #160 from Humm42/closepipes
djpohly Feb 15, 2022
9090106
Merge pull request #164 from Sevz17/change-border-color
djpohly Feb 15, 2022
52a33a2
Merge branch 'scenegraph3' of github:djpohly/dwl into scenegraph3
djpohly Feb 15, 2022
2d2c216
Merge pull request #181 from Armael/fix-client_set_tiled
djpohly Feb 15, 2022
b0098d9
die on allocation failure
noocsharp Feb 23, 2022
d1ff1e6
remove typedef `Decoration`
sevz17 Sep 28, 2021
f83f104
Merge pull request #149 from xi/fix-grabc-unmap
sevz17 Mar 10, 2022
ebed675
Merge pull request #187 from fauxmight/new-clients-printstatus
sevz17 Mar 10, 2022
3e6d584
update URL to wlroots project (GitHub->GitLab)
sevz17 Nov 2, 2021
8cace19
fix crash when the last monitor is disconnected
sevz17 Nov 4, 2021
f673305
replace tabs by spaces in alignment
sevz17 Mar 10, 2022
5d9c9a9
don't warn about unused result
sevz17 Mar 10, 2022
05a4733
use wlr_box for previous geom
sevz17 Mar 10, 2022
2b2f72d
use wlr_scene_output_send_frame_done()
sevz17 Sep 24, 2021
b97d9e1
use wlr_scene_node_raise_to_top()
sevz17 Oct 31, 2021
4465dcb
fix left border 'y' position
sevz17 Feb 15, 2022
c49a42e
Merge pull request #196 from noocsharp/main
sevz17 Mar 12, 2022
0e5d712
use loop to call arrangelayer
sevz17 Jan 26, 2022
4d26d30
suckless style: don't use '//' for comments
sevz17 Mar 12, 2022
08020d6
more style fixes
sevz17 Mar 12, 2022
0c4740b
add dwl(1)
Humm42 Jan 5, 2022
2cd0b31
print status about floating and fullscreen
sevz17 Mar 13, 2022
ebff6e3
always call arrange() on setfullscreen()
sevz17 Mar 13, 2022
43228bd
don't use fullscreen event in fullscreennotify()
sevz17 Mar 14, 2022
88f241d
Merge branch 'fix-segfault-in-fullscreennotify'
sevz17 Mar 14, 2022
1087bc5
use wlr_scene_xdg_surface_create() for xdg_popups
sevz17 Oct 29, 2021
b92c0ff
add support for layer_shell popups
sevz17 Feb 1, 2022
863eedd
set correct position for unmanaged clients
sevz17 Jan 31, 2022
2768af5
make sure configure and activate listeners are removed from list
sevz17 Mar 17, 2022
79f85bd
Merge branch 'main' into scenegraph
sevz17 Mar 17, 2022
294fb32
constraint popups to its parent client
sevz17 Mar 17, 2022
1dfd867
fix crash of Firefox when opening a popup larger than its size
sevz17 Mar 17, 2022
f1c92b0
get old client by surface's node
sevz17 Mar 18, 2022
1b22ef1
use xdg_shell helper
sevz17 Mar 18, 2022
0815626
pointerfocus: only use provided surface
sevz17 Mar 18, 2022
254f799
do not create borders for unmanaged clients
sevz17 Mar 18, 2022
467123d
make sure to destroy wlr_scene_node of unmanaged clients
sevz17 Mar 18, 2022
475c134
do not allow set client size less than its min size
sevz17 Mar 18, 2022
d50bb97
Merge branch 'main' into scenegraph
sevz17 Mar 18, 2022
e4bf83e
update README.md
sevz17 Mar 18, 2022
e645ea8
attach presentation to scene
sevz17 Mar 18, 2022
19c14b0
remove unneeded variables
sevz17 Mar 18, 2022
dd463b2
remove independents list
sevz17 Mar 20, 2022
4493205
Merge pull request #204 from djpohly/scenegraph3
sevz17 Mar 20, 2022
0dea553
destroy scene_output in cleanupmon()
sevz17 Mar 21, 2022
c50f187
improve floating detection
sevz17 Mar 21, 2022
2bc01de
remove a useless resize in mapnotify()
sevz17 Mar 21, 2022
ee1a722
only skip frames if there are visible clients that have a resize
sevz17 Mar 22, 2022
86fe15f
Update issue templates
sevz17 Mar 22, 2022
330792b
implement drag and drop
guidocella Mar 21, 2022
9aec604
clients now works as expected in drag motion
sevz17 Mar 22, 2022
358562e
Merge pull request #180 from Humm42/manpage
sevz17 Mar 22, 2022
6aed9dc
Merge pull request #137 from guidocella/libera
sevz17 Mar 22, 2022
d8f430a
add sway LICENSE file
sevz17 Mar 23, 2022
326eee1
Add a configuration option for fullscreen locking
Jul 12, 2021
7d724dc
Fix dwl freezing when resizing
PalanixYT Feb 28, 2022
4ef8999
add note about how to change MODKEY for windows key
sevz17 Mar 23, 2022
3bace9c
inline the presentation variable
guidocella Mar 23, 2022
7a2e0ee
Revert "clients now works as expected in drag motion"
sevz17 Mar 23, 2022
bf8cc52
set position of the drag icon in startdrag()
sevz17 Mar 23, 2022
feb972a
fix drag icon's surface returned by xytonode
sevz17 Mar 23, 2022
ae614ee
implement idle-inhibitor protocol
sevz17 Jul 13, 2021
a95338c
implement input-inhibitor protocol
sevz17 Jul 3, 2021
cb4265a
check `m` in commitlayersurfacenotify()
sevz17 Mar 24, 2022
aab397c
new functions ecalloc() and die()
sevz17 Mar 15, 2022
2d6f932
don't let -pedantic be overridable by environment
sevz17 Mar 31, 2022
ae31391
initialize rules and xkb_rules
sevz17 Mar 31, 2022
b424602
add DESTDIR
sevz17 Mar 31, 2022
79b7e75
Layer shell: Prevent infinte configure/commit loop
raphaelr Nov 6, 2021
4d3adea
die on pipe failure
sevz17 Mar 31, 2022
720f561
Remove vestigial monitor configuration info
djpohly Apr 3, 2022
6901743
Remove removed fields from struct instances
djpohly Apr 3, 2022
437aea8
It's past my bedtime.
djpohly Apr 3, 2022
02ac937
includes: abc
sevz17 Apr 6, 2022
af741e5
typedefs: abc
sevz17 Apr 6, 2022
c00697e
abc
sevz17 Apr 6, 2022
b86fcf6
add missing return in client_is_floating_type()
sevz17 Apr 11, 2022
eb03bd8
chore: update to v0.3.1
Frewacom Apr 16, 2022
426730a
fix: compile correctly on guix
Frewacom Apr 16, 2022
655b807
fix: remove duplicate includes
Frewacom Apr 16, 2022
ad9a6ac
fix: use tabs for indentation and remove duplicate code
Frewacom Apr 16, 2022
5b35420
fix: use wlroots 0.15.1
Frewacom Apr 16, 2022
6d6bcea
chore: create diffs based on dwl v0.3.1
Frewacom Apr 16, 2022
0be0d3b
fix: load lockfullscreen from config
Frewacom Apr 16, 2022
dc4487a
fix: remove duplicate code
Frewacom Apr 16, 2022
5e7e94b
fix: correctly use keycodes for keybindings
Frewacom Apr 16, 2022
4526350
fix: ensure that fullscreened clients are on top
Frewacom Apr 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ assignees: ''

---

## Info
dwl's commit:
wlroots version:
## Description
<!--
Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors
If the patch author doesn't respond within a reasonable time, email me:

Leonardo Hernández Hernández <[email protected]>

but note that I'm NOT making any promises
-->
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dwl - dwm for Wayland

Copyright © 2020 dwl team

See also the files LICENSE.tinywl and LICENSE.dwm.
See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
19 changes: 19 additions & 0 deletions LICENSE.sway
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2016-2017 Drew DeVault

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ clean:
rm -f dwl *.o *-protocol.h *-protocol.c

install: dwl
install -D dwl $(PREFIX)/bin/dwl
install -Dm755 dwl $(PREFIX)/bin/dwl
install -Dm644 dwl.1 $(MANDIR)/man1/dwl.1

uninstall:
rm -f $(PREFIX)/bin/dwl
rm -f $(PREFIX)/bin/dwl $(MANDIR)/man1/dwl.1

.PHONY: all clean install uninstall

Expand Down Expand Up @@ -65,6 +66,6 @@ dscm-unstable-v1-protocol.c:

dscm-unstable-v1-protocol.o: dscm-unstable-v1-protocol.h

dwl.o: dscm-utils.h dscm-bindings.h dscm-config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h dscm-unstable-v1-protocol.h
dwl.o: dscm-utils.h dscm-bindings.h dscm-config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h dscm-unstable-v1-protocol.h util.h

dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o dscm-unstable-v1-protocol.o
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o util.o dscm-unstable-v1-protocol.o
213 changes: 142 additions & 71 deletions client.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,170 +5,241 @@
* that they will simply compile out if the chosen #defines leave them unused.
*/

/* Leave this function first; it's used in the others */
/* Leave these functions first; they're used in the others */
static inline int
client_is_x11(Client *c)
{
#ifdef XWAYLAND
return c->type == X11Managed || c->type == X11Unmanaged;
return c->type == X11Managed || c->type == X11Unmanaged;
#else
return 0;
return 0;
#endif
}

static inline struct wlr_surface *
client_surface(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->surface;
#endif
return c->surface.xdg->surface;
}

/* The others */
static inline void
client_activate_surface(struct wlr_surface *s, int activated)
{
#ifdef XWAYLAND
if (wlr_surface_is_xwayland_surface(s)) {
wlr_xwayland_surface_activate(
wlr_xwayland_surface_from_wlr_surface(s), activated);
return;
}
if (wlr_surface_is_xwayland_surface(s)) {
wlr_xwayland_surface_activate(
wlr_xwayland_surface_from_wlr_surface(s), activated);
return;
}
#endif
if (wlr_surface_is_xdg_surface(s))
wlr_xdg_toplevel_set_activated(
wlr_xdg_surface_from_wlr_surface(s), activated);
if (wlr_surface_is_xdg_surface(s))
wlr_xdg_toplevel_set_activated(
wlr_xdg_surface_from_wlr_surface(s), activated);
}

static inline void
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
{
wlr_surface_for_each_surface(client_surface(c), fn, data);
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_surface_for_each_surface(c->surface.xwayland->surface,
fn, data);
return;
}
if (client_is_x11(c))
return;
#endif
wlr_xdg_surface_for_each_surface(c->surface.xdg, fn, data);
wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
}

static inline const char *
client_get_appid(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->class;
if (client_is_x11(c))
return c->surface.xwayland->class;
#endif
return c->surface.xdg->toplevel->app_id;
return c->surface.xdg->toplevel->app_id;
}

static inline void
client_get_geometry(Client *c, struct wlr_box *geom)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
geom->x = c->surface.xwayland->x;
geom->y = c->surface.xwayland->y;
geom->width = c->surface.xwayland->width;
geom->height = c->surface.xwayland->height;
return;
}
if (client_is_x11(c)) {
geom->x = c->surface.xwayland->x;
geom->y = c->surface.xwayland->y;
geom->width = c->surface.xwayland->width;
geom->height = c->surface.xwayland->height;
return;
}
#endif
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
}

static inline const char *
client_get_title(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->title;
if (client_is_x11(c))
return c->surface.xwayland->title;
#endif
return c->surface.xdg->toplevel->title;
return c->surface.xdg->toplevel->title;
}

static inline int
client_is_float_type(Client *c)
{
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state state;

#ifdef XWAYLAND
if (client_is_x11(c)) {
struct wlr_xwayland_surface *surface = c->surface.xwayland;
struct wlr_xwayland_surface_size_hints *size_hints;
if (surface->modal)
return 1;

for (size_t i = 0; i < surface->window_type_len; i++)
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog] ||
surface->window_type[i] == netatom[NetWMWindowTypeSplash] ||
surface->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;

size_hints = surface->size_hints;
if (size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
&& (size_hints->max_width == size_hints->min_width ||
size_hints->max_height == size_hints->min_height))
return 1;

return 0;
}
#endif

toplevel = c->surface.xdg->toplevel;
state = toplevel->current;
return (state.min_width != 0 && state.min_height != 0
&& (state.min_width == state.max_width
|| state.min_height == state.max_height))
|| toplevel->parent;
}

static inline int
client_wants_fullscreen(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
for (size_t i = 0; i < c->surface.xwayland->window_type_len; i++)
if (c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeDialog] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeSplash] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;
if (client_is_x11(c))
return c->surface.xwayland->fullscreen;
#endif
return 0;
return c->surface.xdg->toplevel->requested.fullscreen;
}

static inline int
client_is_unmanaged(Client *c)
{
#ifdef XWAYLAND
return c->type == X11Unmanaged;
return c->type == X11Unmanaged;
#endif
return 0;
return 0;
}

static inline void
client_send_close(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_close(c->surface.xwayland);
return;
}
if (client_is_x11(c)) {
wlr_xwayland_surface_close(c->surface.xwayland);
return;
}
#endif
wlr_xdg_toplevel_send_close(c->surface.xdg);
wlr_xdg_toplevel_send_close(c->surface.xdg);
}

static inline void
client_set_fullscreen(Client *c, int fullscreen)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
return;
}
if (client_is_x11(c)) {
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
return;
}
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
}

static inline uint32_t
client_set_size(Client *c, uint32_t width, uint32_t height)
{
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_configure(c->surface.xwayland,
c->geom.x, c->geom.y, width, height);
return 0;
}
if (client_is_x11(c)) {
wlr_xwayland_surface_configure(c->surface.xwayland,
c->geom.x, c->geom.y, width, height);
return 0;
}
#endif
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
}

static inline void
client_set_tiled(Client *c, uint32_t edges)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return;
if (client_is_x11(c))
return;
#endif
wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
}

static inline struct wlr_surface *
client_surface(Client *c)
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->surface;
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
#endif
return c->surface.xdg->surface;
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
}

static inline struct wlr_surface *
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
static inline void
client_min_size(Client *c, int *width, int *height)
{
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
if (client_is_x11(c)) {
struct wlr_xwayland_surface_size_hints *size_hints;
size_hints = c->surface.xwayland->size_hints;
*width = size_hints->min_width;
*height = size_hints->min_height;
return;
}
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
toplevel = c->surface.xdg->toplevel;
state = &toplevel->current;
*width = state->min_width;
*height = state->min_height;
}

static inline Client *
client_from_popup(struct wlr_xdg_popup *popup)
{
struct wlr_xdg_surface *surface = popup->base;

while (1) {
switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL;

surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
return surface->data;
case WLR_XDG_SURFACE_ROLE_NONE:
return NULL;
}
}
}
3 changes: 2 additions & 1 deletion config.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# paths
PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man

# Default compile flags (overridable by environment)
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wdeclaration-after-statement
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement

# Uncomment to build XWayland support
#CFLAGS += -DXWAYLAND
Loading