11 Commits

Author SHA1 Message Date
Andrea Chiavazza 41be906af3 revert to using the static array 2025-03-28 16:37:41 +00:00
Andrea Chiavazza 8d34d53ea5 WIP fix keybindings wrongly causing key repeats on key release 2025-03-28 12:41:38 +00:00
Andrea Chiavazza e23fec173a WIP remove the static array and rework the fix 2025-03-26 12:38:59 +00:00
Andrea Chiavazza 6cff4367ae remove print to stderr 2025-03-26 10:13:22 +00:00
Andrea Chiavazza 82e3bd95fc make the logic more rigorous 2025-03-25 11:04:33 +00:00
Andrea Chiavazza 609d89642c don't pass released-key events of handled events to the clients 2025-03-24 20:23:50 +00:00
Leonardo Hernández Hernández 2783d91611 remove binary before copying to destination
Since Linux 6.11 is possible overwrite a running executable, possibly making it
crash.

Thanks to: movq42rax
Fixes: https://codeberg.org/dwl/dwl/issues/709
References: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2a010c412853
References: https://lore.kernel.org/stable/CACKH++YAtEMYu2nTLUyfmxZoGO37fqogKMDkBpddmNaz5HE6ng@mail.gmail.com/T/#u

(cherry picked from commit 1d08ade132)
2025-03-13 22:00:48 +01:00
Guido Cella b2abff8b57 fix a use after free
This line makes dwl crash after closing mpv with the switchtotag patch.

(cherry picked from commit 8206cc8889)
2025-03-13 21:59:55 +01:00
DreamMaoMao 298c6e1839 fix: crash when open some x11 app
(cherry picked from commit e0f531d508)
2025-03-13 21:58:14 +01:00
Leonardo Hernández Hernández cfc80c8f44 fix crash when a client is created while all outputs are disabled 2024-08-27 23:07:21 -06:00
Leonardo Hernández Hernández 0e0c97db56 changelog: add new 'unreleased' section 2024-08-27 23:07:13 -06:00
3 changed files with 29 additions and 5 deletions
+14
View File
@@ -1,10 +1,24 @@
# Changelog # Changelog
* [Unreleased](#unreleased)
* [0.7](#0.7) * [0.7](#0.7)
* [0.6](#0.6) * [0.6](#0.6)
* [0.5](#0.5) * [0.5](#0.5)
## Unreleased
### Added
### Changed
### Deprecated
### Removed
### Fixed
* Crash when a client is created while all outputs are disabled.
### Security
### Contributors
## 0.7 ## 0.7
See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x. See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x.
+1
View File
@@ -61,6 +61,7 @@ dist: clean
install: dwl install: dwl
mkdir -p $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/bin
rm -f $(DESTDIR)$(PREFIX)/bin/dwl
cp -f dwl $(DESTDIR)$(PREFIX)/bin cp -f dwl $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man1
+14 -5
View File
@@ -803,8 +803,10 @@ commitnotify(struct wl_listener *listener, void *data)
* a wrong monitor. * a wrong monitor.
*/ */
applyrules(c); applyrules(c);
wlr_surface_set_preferred_buffer_scale(client_surface(c), (int)ceilf(c->mon->wlr_output->scale)); if (c->mon) {
wlr_fractional_scale_v1_notify_scale(client_surface(c), c->mon->wlr_output->scale); wlr_surface_set_preferred_buffer_scale(client_surface(c), (int)ceilf(c->mon->wlr_output->scale));
wlr_fractional_scale_v1_notify_scale(client_surface(c), c->mon->wlr_output->scale);
}
setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */ setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */
wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel, WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN); wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel, WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
@@ -1175,7 +1177,6 @@ void
destroydecoration(struct wl_listener *listener, void *data) destroydecoration(struct wl_listener *listener, void *data)
{ {
Client *c = wl_container_of(listener, c, destroy_decoration); Client *c = wl_container_of(listener, c, destroy_decoration);
c->decoration = NULL;
wl_list_remove(&c->destroy_decoration.link); wl_list_remove(&c->destroy_decoration.link);
wl_list_remove(&c->set_decoration_mode.link); wl_list_remove(&c->set_decoration_mode.link);
@@ -1590,6 +1591,7 @@ keypress(struct wl_listener *listener, void *data)
int handled = 0; int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard); uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
static bool consumed[KEY_MAX + 1];
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat); wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -1611,9 +1613,16 @@ keypress(struct wl_listener *listener, void *data)
wl_event_source_timer_update(group->key_repeat_source, 0); wl_event_source_timer_update(group->key_repeat_source, 0);
} }
if (handled) if (handled) {
consumed[event->keycode] = true;
return; return;
}
if (consumed[event->keycode]) {
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED)
consumed[event->keycode] = false;
return; // don't pass to the client the release event of a handled key-press
}
wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard); wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
/* Pass unhandled keycodes along to the client. */ /* Pass unhandled keycodes along to the client. */
wlr_seat_keyboard_notify_key(seat, event->time_msec, wlr_seat_keyboard_notify_key(seat, event->time_msec,
@@ -3141,7 +3150,7 @@ sethints(struct wl_listener *listener, void *data)
{ {
Client *c = wl_container_of(listener, c, set_hints); Client *c = wl_container_of(listener, c, set_hints);
struct wlr_surface *surface = client_surface(c); struct wlr_surface *surface = client_surface(c);
if (c == focustop(selmon)) if (c == focustop(selmon) || !c->surface.xwayland->hints)
return; return;
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints); c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);