raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
268 stars 63 forks source link

Tab with unselected activity does not get highlighted #311

Open urbanware-org opened 3 years ago

urbanware-org commented 3 years ago

Here is something I recently experienced with various programs.

For example, let's assume I have a few text files and want to open them one after another with Gedit.

  1. Inside my file manager, I right-click the first one and open it using Gedit, which is not running.
  2. Gedit starts, has the focus and shows the content of the text file. So far, so good.
  3. Then, I switch back to my file manager, select the next file and open it the same way.
  4. The focus stays on the window of my file manager, I can see the Gedit tab title changes, but the tab does not get highlighted.
  5. When I switch to Gedit, both files are opened (as expected).

In the past (as far as I have noticed before migrating to Notion 4) the tab has been highlighted when Gedit was already running and another file was opened while it did not have the focus.

My Notion look does not seem to be the reason for this. I tried another looks with the same result.

I'm currently using Notion 4.0.2-1.

buhl commented 3 years ago

Not sure if this helps. But could it have something to do with URGENT hints?

urbanware-org commented 3 years ago

What exactly do you mean?

buhl commented 3 years ago

I have something like this in my theme

de.defstyle("stdisp-statusbar", {
    de.substyle("activity", { 
        foreground_colour = "#eeeeee", 
        background_colour = "#901010",
    }),

})

de.defstyle("actnotify", {
    pos = "tl",
})

It will notify me when a window (not in focus) gets the urgency hint. A test could be to run sleep 5 && echo -e "\a" in a terminal window and then remove focus from it.

urbanware-org commented 3 years ago

Ah, I see.

I have something like this in my theme

I have some similar code inside mine:

de.defstyle("actnotify", {
    shadow_colour = "#00448d",
    highlight_colour = "#007cff",
    background_colour = "#005dc0",
    foreground_colour = "#ffffff",
})

A test could be to run sleep 5 && echo -e "\a" in a terminal window and then remove focus from it.

Thanks for the tip!

I executed that command inside a terminal and first it did not work. Then, I enabled the visual terminal bell (usually disabled) and retried. With that it works for the terminal.

Nevertheless, I'm wondering why it does not work with Gedit as well as other programs (where Gedit is the lesser problem).

As already mentioned it used to work before. 🤔

buhl commented 3 years ago

I have never used gedit. Could it be that Gedit no longer set urgency when opening new files? What version of notion did you migrate from?

urbanware-org commented 3 years ago

I have never used gedit

I don't use it often, but it was the first time, I noticed that behavior.

Could it be that Gedit no longer set urgency when opening new files?

I think that's rather unlikely. As already mentioned, there are further programs affected. Gedit is just the simplest example.

When using virt-manager the problem is very annoying. I have multiple screens at work with multiple workspaces where the consoles ("screens") of multiple virtual machines are open. When I double-click at a virtual machine inside the virtual machine list, its "screen" opens. In the past, when I double-clicked a virtual machine, which was already running, Notion highlighted the tab and I could instantly see on which workspace of which screen the machine is located.

Also here, I currently have same behavior as with Gedit. So, if I double-click a virtual machine that is already open somewhere, nothing happens. I have to search for myself on which workspace on which screen it is located. This takes time and nerves.

What version of notion did you migrate from?

The last release I productively used was 3-2017050501 (later versions were running on experimental systems). However, I have not taken over my configuration one-by-one. I compared the old files with the new ones and adjusted those.

Everything with Notion works absolutely fine, except for this issue.

buhl commented 3 years ago

Hmm, not sure I can help with this issue. If you have the time you could try to go back to a commit where things worked as before. Then use git bisect to find a commit where it stops working.

But while you have this issue maybe the focus list menu could help you save some time and nerves? The new bindings are META+o o and then you can type something unique to the window title and press enter.

urbanware-org commented 3 years ago

First of all, thanks for your help. I really appreciate it.

If you have the time you could try to go back to a commit where things worked as before. Then use git bisect to find a commit where it stops working.

I will do so as soon as I find the time as this'll take a while to figure out, I guess.

But while you have this issue maybe the focus list menu could help you save some time and nerves?

Thanks for the tip! :+1:

buhl commented 3 years ago

@raboof at some point in notions history we had to remove/rewrite part of the code base due to licensing isues. Do you know what commit the code was removed/rewritten? Maybe @urbanware-org could try to go back just before the changes was made?

raboof commented 3 years ago

For Notion 4, we took the version of Notion 3 at a point in time where it was still LGPL-licensed, and then 'skipped over' the part of the history that was Ion-licensed. Indeed some features that were added in the 'Ion license' era were lost, some were re-implemented again 'cleanly' on the Notion 4 branch.

I think looking at the history isn't going to help much here, even if we find the commit where this feature was added/broken we can probably not use it since it's Ion-licensed.

It might be worth checking if the problem also exists on Notion 4.0.0 (likely so), and in that case re-implement the feature from scratch in LGPL on Notion 4.