Rafostar / gnome-shell-extension-pip-on-top

Makes "Picture-in-Picture" windows stay on top (even on Wayland session). Compatible with Firefox, but may work with few other browsers too.
GNU General Public License v2.0
53 stars 10 forks source link

Handle window titles with lowercase 'picture' #7

Closed emansom closed 2 years ago

emansom commented 2 years ago

Using Firefox with the Dutch language, the window title ends with a lowercase picture and it yields non functional behavior.

Schermafdruk van 2022-06-30 04-32-56

This MR resolves the issue.

Likely there's a deeper issue with the Dutch translation not being picked up correctly, haven't looked into that.

Rafostar commented 2 years ago

Oh, that's interesting. There seems to be some sort of global fallback to "Picture-in-picture" title among different browsers/languages (like in: #6). The string here (with second word from lower letter) does not appear in Firefox translation files. Not sure where it comes from, but seems to occur in multiple browsers when translation is missing (maybe its hardcoded).

If so, then it would probably be better to go with #6 approach, since this is a single string only and avoids string duplication into lower case (performs faster).

emansom commented 2 years ago

Oh, that's interesting. There seems to be some sort of global fallback to "Picture-in-picture" title among different browsers/languages (like in: #6). The string here (with second word from lower letter) does not appear in Firefox translation files. Not sure where it comes from, but seems to occur in multiple browsers when translation is missing (maybe its hardcoded).

Several Firefox language packs are installed on my host via package manager. LANG environment variable is set system-wide to nl_NL.UTF-8.

Maybe Firefox can't decide which one to use and defaults to fallback? 🤷🏻‍♂️

If so, then it would probably be better to go with #6 approach, since this is a single string only and avoids string duplication into lower case (performs faster).

String comparison operations take nanoseconds, it won't have any meaningful effect on performance whatsoever. Humans perceive things in the realm of tens of milliseconds, not nanoseconds. Doing the lowered string comparison covers more niche cases.

It is however your project, you decide. 👍🏻

Rafostar commented 2 years ago

@emansom

String comparison operations take nanoseconds, it won't have any meaningful effect on performance whatsoever.

Comparison, yes. But I was talking about string duplication before its compared. With this commit it would be 2 duplicated strings for each window on the workspace. And yes, it will be pretty much unnoticeable and I wouldn't be such a nitpicker, if this code wasn't running as part of GNOME Shell. I am just trying to be extra careful and mindful of GNOME Shell performance.

Rafostar commented 2 years ago

Superseded by #6