summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@proton.me>2024-06-20 23:32:44 -0600
committerLeonardo Hernández Hernández <leohdz172@proton.me>2024-06-20 23:32:44 -0600
commitbaedf7f7918976757fbdd1b11649f0820482d1c6 (patch)
tree1ccdba9e916b9f9b91e9fbd10f1d646a43326b18
parent4cf1d604b8912fdd5854f4a1d981cdfc5955b890 (diff)
parent845d3c47bd5dc8c7c7966e835579f10e69c5d92e (diff)
Merge remote-tracking branch 'upstream/main' into wlroots-next
-rw-r--r--Makefile20
-rw-r--r--dwl.c8
2 files changed, 18 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 23cdf33..aa3009f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,12 @@
include config.mk
# flags for compiling
-DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
-DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\
- -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion
+DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
+ -DVERSION=\"$(VERSION)\" $(XWAYLAND)
+DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
+ -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
+ -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
+ -Wfloat-conversion
# CFLAGS / LDFLAGS
PKGS = wlroots-0.18 wayland-server xkbcommon libinput $(XLIBS)
@@ -16,7 +19,9 @@ LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
-dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
+dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
+ pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
+ wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
util.o: util.c util.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland
@@ -48,8 +53,8 @@ clean:
dist: clean
mkdir -p dwl-$(VERSION)
- cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h\
- config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop\
+ cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h \
+ config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop \
dwl-$(VERSION)
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
rm -rf dwl-$(VERSION)
@@ -65,7 +70,8 @@ install: dwl
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
+ rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
+ $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
.SUFFIXES: .c .o
.c.o:
diff --git a/dwl.c b/dwl.c
index 32eaba6..1a29c97 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2074,14 +2074,16 @@ powermgrsetmode(struct wl_listener *listener, void *data)
{
struct wlr_output_power_v1_set_mode_event *event = data;
struct wlr_output_state state = {0};
+ Monitor *m = event->output->data;
- if (!event->output->data)
+ if (!m)
return;
+ m->gamma_lut_changed = 1; /* Reapply gamma LUT when re-enabling the ouput */
wlr_output_state_set_enabled(&state, event->mode);
- wlr_output_commit_state(event->output, &state);
+ wlr_output_commit_state(m->wlr_output, &state);
- ((Monitor *)(event->output->data))->asleep = !event->mode;
+ m->asleep = !event->mode;
}
void