GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.
So, the popover (context menu) actually appears slightly off vertically when someone right clicks on the widget for some reason.
So when someone right-clicks, the popover appears and is directly under the cursor, which can lead to users accidentally clicking on the option to open a new window if you didn't hold right click.
The same issue is also happening horizontally, thus you see the insane code above.
tab_pos fetches the index of the tab and then increments it by 1. It's an unsigned integer and is always incremented so there's no chance the number could be 0.
now thinking about it, I think I remember this code was in the tab widget instead of the actual terminal widget, so it's relative to the tab, not the actual main view. That might explain why.
3
u/IAMPowaaaaa Jan 16 '23
language?
1
u/suprsiksuprchik Jan 17 '23
We NEVER know why it works. Please God be with this person and let the light shine unto his path of all things holy in coding. Good luck! Lol
1
u/slideesouth Jan 17 '23
I’m totally fine with WTFs as long as they include a “//wtf:” warning comment and every step is well documented
1
u/[deleted] Jan 17 '23
[removed] — view removed comment