Re: Some enhancements for stack based window switching
Vitaly Shevtsov <[email protected]> Wed, 27 Jul 2022 02:11:49 +0500
| Newsgroups | gmane.comp.window-managers.ctwm |
|---|---|
| Message-ID | <CAPHwUj6LyRtvoS-yS2wEyXWKW7HUoUhCWDkgy4TPKensdhrhzw@mail.gmail.com> |
I'm sorry, I've attached the wrong file. This is the correct one On Wed, Jul 27, 2022 at 1:34 AM Vitaly Shevtsov <[email protected]> wrote: > > Hello! I tried a patch that implements stack-based window switching. > This works pretty much as I would expect, except for one thing. ctwm > does not update the stack when a window receives focus. I made some > changes to the attached patch. Could you review it and let me know > what you think? This updates the stack when the window gets focus and > makes ctwm more usable (from my point of view). > -- > Vitaly -- Vitaly
ctwm_update_stack_on_focus.diff
(text/x-patch, 890 B)
diff --git a/win_ops.c b/win_ops.c
index 4bb5842a..07ef341f 100644
--- a/win_ops.c
+++ b/win_ops.c
@@ -18,6 +18,7 @@
#include "win_iconify.h"
#include "win_ops.h"
#include "win_utils.h"
+#include "win_ring.h"
/*
@@ -103,6 +104,7 @@ SetFocusVisualAttributes(TwmWindow *tmp_win, bool focus)
if(tmp_win->iconmanagerlist) {
NotActiveIconManager(tmp_win->iconmanagerlist);
}
+
}
if(Scr->use3Dtitles && Scr->SunkFocusWindowTitle && tmp_win->title_height) {
ButtonState bs;
@@ -172,6 +174,13 @@ SetFocus(TwmWindow *tmp_win, Time tim)
// Pre-sets Scr->Focus
}
#endif
+
+ if (Scr->StackLeader) {
+ UnlinkWindowFromRing(tmp_win);
+ AddWindowToRingUnchecked(tmp_win, Scr->StackLeader->ring.prev);
+ Scr->RingLeader = tmp_win;
+ Scr->StackLeader = NULL;
+ }
}
// in the EWMH cases, this was already done.