projecthamster / hamster

GNOME time tracker
http://projecthamster.org
GNU General Public License v3.0
1.05k stars 250 forks source link

Category and activity suggestions are misplaced #658

Open karliss opened 3 years ago

karliss commented 3 years ago

In a multi monitor setup suggestions for activity and category fields are positioned incorrectly. Depending on how bad it is it may be so far that it's not visible at all.

hamster_category

Problem happens on all the monitors except the leftmost one. In the configuration bellow thats 2 and 3. Screenshot from 2020-12-11 21-20-39

If I change the layout so that 2 is leftmost one, position is wrong on monitors 1 and 3.

Screenshot from 2020-12-11 21-21-40

I looked at the code and it seems that category and activity fields are using more or less standard GtkEntry and GtkEntryCompletion and the popup part is created by GtkEntryCompletion. In other instances of wayland popup issues like #652 popups were incorrectly created by Hamster code, in this case it might be a GTK issue. This theory could be tested by checking what happens with other GTK programs using GtkEntryCompletion.

Test environment:

karliss commented 3 years ago

Verified that the problem doesn't happen when logging in using X instead of Wayland

karliss commented 3 years ago

While searching for other GTK programs using GtkEntryCompletion on github I found this https://github.com/polter-rnd/gtk3-patched/blob/d99710dc05d611e78bf7f6e56f0ee561350ecd42/Fix-GtkEntryCompletion.patch so it might be a known GTK bug.

karliss commented 3 years ago

The corresponding custom position calculation code got removed during 3.9x development https://github.com/GNOME/gtk/commit/0cc94ed72e62f2e09d556d912ef5b4550f3c70ef

matthijskooijman commented 1 year ago

I can still reproduce this problem on Ubuntu 22.10 with gnome 43.1 and the hamster flatpak built on git master.

InRiPa commented 8 months ago

Just wondering, so is it a gtk issue or an issue with the hamster app?

Flupp commented 2 months ago

I can confirm the issue on Plasma 6 with Wayland. I did not have this issue on Plasma 5 with X11.

I tried reproducing the issue with gtk-demo, but I was not able to reproduce. Especially the demo “Combo boxes” works fine for me.

karliss commented 2 months ago

Especially the demo “Combo boxes” works fine for me.

It's not a dropdown menu/combo box. It looks similar to one but it's an input field+ GtkEntryCompletion https://developer-old.gnome.org/gtk3/stable/GtkEntryCompletion.html . At least that's how it was when I looked at the hamster code 4 years ago. Entry/Entry completion from the gtk-demo is probably more representative of the problematic widget.

Tried searching for other gtk programs using it again https://github.com/search?q=gtk_entry_completion_set_popup_completion+TRUE&type=code . Was also able to repeat it in Geany/File Browser plugin and gtk3-demo . So It's probably a GTK bug.

Tried gtk4-demo/Entry/Entry completion that one wasn't affected by the bug. So maybe fixed in gtk4.

gtk3-demo: gtk3-demo gtk4-demo: gtk4-demo