From db9b136766e5a3b24ca87a9a2f3810c668ba4bf9 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Thu, 26 Jan 2023 16:58:38 -0700 Subject: [PATCH] fix microsleep and add config option; update manual; v1.4.1 --- config.def.h | 9 +++++++++ event.c | 29 ++++++++++++++++------------- main.c | 2 +- ryudo.1 | 7 ++----- ryudo.1.html | 10 ++++------ ryudo.1.md | 4 +--- 6 files changed, 33 insertions(+), 28 deletions(-) diff --git a/config.def.h b/config.def.h index 4f81899..10ddae9 100644 --- a/config.def.h +++ b/config.def.h @@ -54,6 +54,7 @@ "Alacritty", \ "kate", \ "acme", \ + "st-256color",\ 0 \ } @@ -101,6 +102,12 @@ * BEHAVIOR * [Everything in this section is optional unless otherwise noted] ***********/ +/* Microseconds to wait before centering terminal windows spawned by keyboard; + * if your system is wicked fast you can lower this; if very old/slow, you may + * have to raise it. + */ +#define MICROSLEEP_DELAY 100000 + /* This sets the size ratio for windows spawned via keyboard or * center-snapped; CENTERNUM should be >= 2, so use 2/4 instead of 1/2 */ @@ -146,6 +153,7 @@ #define AUTOSTICK {\ "XOsview", \ "XClock", \ + "xneralie", \ 0 \ } @@ -156,6 +164,7 @@ */ #define TERMINALS {\ + "st-256color", \ "term", \ "Term", \ "xvt", \ diff --git a/event.c b/event.c index f0c5d3e..456dd10 100644 --- a/event.c +++ b/event.c @@ -18,6 +18,10 @@ #include "fns.h" #include "patchlevel.h" +#ifndef MICROSLEEP_DELAY +#define MICROSLEEP_DELAY 100000 +#endif + void mainloop(int shape_event) { static XEvent ev; static Client* c; @@ -212,6 +216,9 @@ void configurereq(XConfigureRequestEvent* e) { void mapreq(XMapRequestEvent* e) { Client* c; int i; + XRRMonitorInfo monitor; + + monitor = monitorinfo[getmonitorbymouse()]; curtime = CurrentTime; c = getclient(e->window, 0); @@ -233,6 +240,15 @@ void mapreq(XMapRequestEvent* e) { } } + if (kbLaunch) { + usleep(MICROSLEEP_DELAY); +#ifdef CENTERVMAX + centerclient(c, monitor, 1); +#else + centerclient(c, monitor, 0); +#endif + kbLaunch = 0; + } switch (c->state) { case WithdrawnState: if (c->parent == c->screen->root) { @@ -298,9 +314,6 @@ void circulatereq(XCirculateRequestEvent* e) { void newwindow(XCreateWindowEvent* e) { Client* c; ScreenInfo* s; - XRRMonitorInfo monitor; - - monitor = monitorinfo[getmonitorbymouse()]; /* we don't set curtime as nothing here uses it */ if (e->override_redirect) @@ -341,16 +354,6 @@ void newwindow(XCreateWindowEvent* e) { 1); } #endif - - if (kbLaunch) { - usleep(100000); -#ifdef CENTERVMAX - centerclient(c, monitor, 1); -#else - centerclient(c, monitor, 0); -#endif - kbLaunch = 0; - } } void destroy(Window w) { diff --git a/main.c b/main.c index cef71fd..c2c833f 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ #include "patchlevel.h" char* version[] = { - "ryudo version 1.3.3\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ " + "ryudo version 1.4.1\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ " "Cox,\n(c) 2019-2022 Derek Stevens", 0}; diff --git a/ryudo.1 b/ryudo.1 index 6747685..7420508 100644 --- a/ryudo.1 +++ b/ryudo.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "RYUDO" "1" "March 2022" "" "" +.TH "RYUDO" "1" "January 2023" "" "" . .SH "NAME" \fBryudo\fR \- The floatiling window manager that flows @@ -180,10 +180,7 @@ The following operations are bindable to key combinations (shown are the default .IP "" 0 . .SH "BUGS AND CAVEATS" -Click events don\'t pass through when clicking to activate a window\. -. -.P -Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window\. I personally sometimes find this behavior useful\. +Switching very fast back and forth between virtual desktops may cause the window manager to stop managing some windows\. Still looking into why\. . .P Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at\. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so\. If the program expects to run at the current screen resolution, the window\-wrangling heuristics should maximize it and you\'ll be golden\. If the window is in override\-redirect mode, it should just run fullscreen without a hitch\. diff --git a/ryudo.1.html b/ryudo.1.html index 4dc63d7..244a1ed 100644 --- a/ryudo.1.html +++ b/ryudo.1.html @@ -178,9 +178,7 @@

BUGS AND CAVEATS

-

Click events don't pass through when clicking to activate a window.

- -

Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window. I personally sometimes find this behavior useful.

+

Switching very fast back and forth between virtual desktops may cause the window manager to stop managing some windows. Still looking into why.

Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so. If the program expects to run at the current screen resolution, the window-wrangling heuristics should maximize it and you'll be golden. If the window is in override-redirect mode, it should just run fullscreen without a hitch.

@@ -191,8 +189,8 @@

AUTHORS

@@ -204,7 +202,7 @@
  1. -
  2. March 2022
  3. +
  4. January 2023
  5. ryudo(1)
diff --git a/ryudo.1.md b/ryudo.1.md index f9c3e75..f8884ef 100644 --- a/ryudo.1.md +++ b/ryudo.1.md @@ -93,9 +93,7 @@ The following operations are bindable to key combinations (shown are the default ## BUGS AND CAVEATS -Click events don't pass through when clicking to activate a window. - -Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window. I personally sometimes find this behavior useful. +Switching very fast back and forth between virtual desktops may cause the window manager to stop managing some windows. Still looking into why. Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so. If the program expects to run at the current screen resolution, the window-wrangling heuristics should maximize it and you'll be golden. If the window is in override-redirect mode, it should just run fullscreen without a hitch.