diff --git a/mmsg/mmsg.c b/mmsg/mmsg.c index 7f406d5..6f350ed 100644 --- a/mmsg/mmsg.c +++ b/mmsg/mmsg.c @@ -41,6 +41,7 @@ static int xflag; static int eflag; static int kflag; static int bflag; +static int Aflag; static uint32_t occ, seltags, total_clients, urg; @@ -264,6 +265,18 @@ static void dwl_ipc_output_kb_layout(void *data, printf("kb_layout %s\n", kb_layout); } +static void +dwl_ipc_output_scalefactor(void *data, + struct zdwl_ipc_output_v2 *dwl_ipc_output, + const unsigned int scalefactor) { + if (!Aflag) + return; + char *output_name = data; + if (output_name) + printf("%s ", output_name); + printf("scale_factor %f\n", scalefactor / 100.0f); +} + static void dwl_ipc_output_keymode(void *data, struct zdwl_ipc_output_v2 *dwl_ipc_output, const char *keymode) { @@ -413,6 +426,7 @@ static const struct zdwl_ipc_output_v2_listener dwl_ipc_output_listener = { .last_layer = dwl_ipc_output_last_layer, .kb_layout = dwl_ipc_output_kb_layout, .keymode = dwl_ipc_output_keymode, + .scalefactor = dwl_ipc_output_scalefactor, .frame = dwl_ipc_output_frame, }; @@ -490,7 +504,7 @@ static void usage(void) { "\t%s [-OTLq]\n" "\t%s [-o ] -s [-t ] [-l ] [-c ] [-d " ",,,,,]\n" - "\t%s [-o ] (-g | -w) [-Ootlcvmfxekb]\n", + "\t%s [-o ] (-g | -w) [-OotlcvmfxekbA]\n", argv0, argv0, argv0); exit(2); } @@ -732,6 +746,12 @@ int main(int argc, char *argv[]) { usage(); mode |= GET; break; + case 'A': + Aflag = 1; + if (mode == SET) + usage(); + mode |= GET; + break; default: fprintf(stderr, "bad option %c\n", ARGC()); usage(); @@ -741,9 +761,10 @@ int main(int argc, char *argv[]) { usage(); if (mode & GET && !output_name && !(oflag || tflag || lflag || Oflag || Tflag || Lflag || cflag || - vflag || mflag || fflag || xflag || eflag || kflag || bflag || dflag)) + vflag || mflag || fflag || xflag || eflag || kflag || bflag || + Aflag || dflag)) oflag = tflag = lflag = cflag = vflag = mflag = fflag = xflag = eflag = - kflag = bflag = 1; + kflag = bflag = Aflag = 1; display = wl_display_connect(NULL); if (!display) diff --git a/protocols/dwl-ipc-unstable-v2.xml b/protocols/dwl-ipc-unstable-v2.xml index a43a7f0..5852107 100644 --- a/protocols/dwl-ipc-unstable-v2.xml +++ b/protocols/dwl-ipc-unstable-v2.xml @@ -241,6 +241,13 @@ I would probably just submit raphi's patchset but I don't think that would be po + + + scale factor of monitor. + + + + diff --git a/src/ext-protocol/dwl-ipc.h b/src/ext-protocol/dwl-ipc.h index c748565..a2bbdbd 100644 --- a/src/ext-protocol/dwl-ipc.h +++ b/src/ext-protocol/dwl-ipc.h @@ -206,6 +206,12 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) { zdwl_ipc_output_v2_send_keymode(ipc_output->resource, keymode.mode); } + if (wl_resource_get_version(ipc_output->resource) >= + ZDWL_IPC_OUTPUT_V2_SCALEFACTOR_SINCE_VERSION) { + zdwl_ipc_output_v2_send_scalefactor(ipc_output->resource, + monitor->wlr_output->scale * 100); + } + zdwl_ipc_output_v2_send_frame(ipc_output->resource); } diff --git a/src/mango.c b/src/mango.c index 2fb2e63..6f7b3fe 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5369,7 +5369,6 @@ void updatemons(struct wl_listener *listener, void *data) { if ((c = focustop(m)) && c->isfullscreen) resize(c, m->m, 0); - config_head->state.x = m->m.x; config_head->state.y = m->m.y;