Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Focus cycle to root window #78

Open
huijunchen9260 opened this issue May 7, 2020 · 7 comments
Open

Focus cycle to root window #78

huijunchen9260 opened this issue May 7, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@huijunchen9260
Copy link

Today I tried sowm, and I realize some problems.

Let's say we have two windows in the same workspace. When I cycle through them, it does not cycle between them. It is cycling window1, window 2, root window, which is very annoying. Also, if I cycled on root window and close it, the whole windows manager crash, and I have to use tty to get rid of it.

Another possible improvement is let the focused window have some hint, like colored border or something.

@dylanaraps dylanaraps added the bug Something isn't working label May 7, 2020
@Unixsys
Copy link

Unixsys commented May 26, 2020

Another possible improvement is let the focused window have some hint, like colored border or something.

See PR #74, specifically my comment regarding it. However, the README.md file clearly states

  • No borders

I hope #74 gets fixed soon, though.

It is cycling window1, window 2, root window, which is very annoying.

From what I've gathered from context and looking at the source code with my untrained eye, it appears that windows are in an array. Therefore, why not try removing the root window from the array? On second thought, that would surely break things.

@huijunchen9260
Copy link
Author

See PR #74, specifically my comment regarding it. However, the README.md file clearly states

I don't really think PR #74 really solve the problem I mentioned. I am not saying the window border, but a kind of visual hint that indicating this window is focused. Border is just a possible way of visual hint, but PR #74 is just adding border to every window, rather provide such visual hint on focused window

It is cycling window1, window 2, root window, which is very annoying.

From what I've gathered from context and looking at the source code with my untrained eye, it appears that windows are in an array. Therefore, why not try removing the root window from the array? On second thought, that would surely break things.

I really know nothing about c...I just cannot help to solve this bug, and hope that someone can fix it soon.

@Unixsys
Copy link

Unixsys commented May 28, 2020

@huijunchen9260, I'm looking into dynamically colored borders.

Another possible improvement is let the focused window have some hint, like colored border or something.

Also, you probably would want to make a new issue for that. I hope this finds you well.

@kjjjnob
Copy link

kjjjnob commented Jun 23, 2020

Let's say we have two windows in the same workspace. When I cycle through them, it does not cycle between them. It is cycling window1, window 2, root window, which is very annoying. Also, if I cycled on root window and close it, the whole windows manager crash, and I have to use tty to get rid of it.

The exact same thing has happened to me but I was able to identify it after a notification from Telegram arrived (ws2) working on ws1. Then the desktop behaves like another window.
Is there a way to debug these compartments?

2020-06-23-191033_1920x1080_scrot

@Unixsys
Copy link

Unixsys commented Jun 25, 2020

@kjjjnob Woah, trippy. I'm thinking of adding a check in win_kill (via PR) to avoid killing the root window. Example:

void win_kill(const Arg arg) {
    if (cur) XKillClient(d, cur->w);
}

to

void win_kill(const Arg arg) {
    if !(cl.res_class == 'root_window') { /* I'd have to find out the class of the root window */
        if (cur) XKillClient(d, cur->w);
    }
}

I can make this smaller, just a prototype. Also I'm going to have to brush up on C.

I haven't been able to test because I don't have a sowm nearby, but I think someone can use xdotool. Something like sleep 10; xdotool getactivewindow to give some delay to switch to the root window.

EDIT:

Is there a way to debug these compartments?

You could just add a bunch of calls to printf to debug.

@kjjjnob
Copy link

kjjjnob commented Jul 6, 2020

void win_kill(const Arg arg) {
    if !(cl.res_class == 'root_window') { /* I'd have to find out the class of the root window */
        if (cur) XKillClient(d, cur->w);
    }
}

This conditional kill 'root_window' if is present?
I can test and try a solution if you need. I dont understand much about C development, but if you need some help with something Im here. Thanks!

@r-odriguez
Copy link

Wouldn't be better if the window cycle skipped the root window? that could be implemented in win_next() and win_prev(). Unfortunately I'm not a C dev neither have familiarity with X11 lib. If someone wants this bug fixed I'd gladly help but I don't know how to do it.

If you have some good resource to learn that, I would appreciate a lot, and, fix this afterwards.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants