-
Notifications
You must be signed in to change notification settings - Fork 648
[window] Prefer GTK icon theme over NET_WM_ICON #1702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think this patch implements correct behavior. |
Oh ye, I assume you mean like an email app setting "X unread messages" in the corner of the icon? |
maybe get the applications to use the correct icon theme instead? |
Hmmm ye, I guess the source of the problem isn't really rofi but how my environment sets (or does not set) the application icons that are sent. Definitely seems better to fix that instead if that is the case. |
I tried my patch in a different window manager (awesomewm instead of bspwm) but saw the same behaviour as shown in my prior screenshots. Were you implying earlier that each individual application (kitty, obs etc.) would need to be patched to provide an icon from the active GTK theme (in queries for their |
I have no idea what a window manager has to do with what icon an application set for itself. I don't know how applications exactly do this, I guess it depends on the application. But I am not going to change rofi default behavior, that seems correct, because a user finds it 'ugly'. |
Ye, the window manager is probably unrelated 😅 My main gripe with the current behaviour is that the But I am fine with using my fork instead if this is not desirable as the default. |
I don't think you read my reply right. I am not going to change the default behaviour, this does not rule out an config option to change the default behaviour. |
Oh ok, I guess I will reopen the issue then. |
I think gtk icons is not the right name, |
doc/rofi.1.markdown
Outdated
@@ -585,6 +585,9 @@ Default: *"wmctrl -i -R {window}"* | |||
|
|||
Show window thumbnail (if available) as icon in the window switcher. | |||
|
|||
`-window-prefer-icon-theme` | |||
|
|||
Use icons from the current GTK theme in window mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not 'gtk theme'. It is the icon theme set, this is not directly dependent on gtk.
Rofi f.e. has it own set icon-theme option, and this will be used when set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to 'icon theme', does it need to be more verbose in some other way?
} else if (c->icon == NULL && c->icon_checked == FALSE) { | ||
c->icon = get_net_wm_icon(rmpd->ids->array[selected_line], size); | ||
c->icon_checked = TRUE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logic correct? when config.window_prefer_icon_theme
is not set, it will never fall back to the 'class icon' when the application has no net_wm_icon
set.
It now always requests this icon, even when not used. This seems wasteful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to address this in 4bd7d3b
Only fetch the NET_WM_ICON and theme icon when their counterpart is NULL as a fallback for each state of the `-window-prefer-icon-theme` flag.
Going over the patch, there is a small possible glitching issue. It might show the application set by the application, then the one from the theme. |
Pushed the extension to rofi_icon_fetcher and directly implemented this request (this exposed another small issue, so decided to commit the whole). Can you test? |
Thanks to Kafva (https://github.com/Kafva) for the original patch. Issue: #1702
|
Ye, tested the new option via CLI and from the config file, both seem to work as expected 🙂 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have noticed that the
window
mode does not pick up certain icons from the icon theme set ingtk-3.0.ini
. Looking at window.c I can see that this is to be expected since the class name that is used to look up the icon name is not guaranteed to be correct.However, currently the NETWM icon seems to override any GTK icons that are found, this patch is meant to address this.
Before/after patch using:
(theme)

