Skip to content
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

Create a dummy button in the sidebar #1095

Merged
merged 1 commit into from
May 1, 2024

Conversation

gycsaba96
Copy link
Contributor

Fixes #1017 and the following points of #1018:

  • If you drag a child out of a parent, the selected tag in the sidebar resets to "All Tasks" view
  • If you drag a standalone task into a parent (turning the task into a child), the selected tag in the sidebar resets to "All Tasks" view

Based on a forum discussion, if the currently focused widget is removed, Gtk.Window selects the first suitable children. This is the "All Tasks" row in our case, thus causing a view reset. Other cases can also reproduce the anomaly: reparenting a tag, deleting a task, etc.

Now, an invisible button catches the focus instead of the "All Tasks" row. Thanks to this button, unintended view resets can be avoided when the focused widget is removed.

Theoretically, we could define a focus grab for each of these special cases. However, we would risk that we miss one and the bug comes back. Moreover, this change doesn't affect the complexity of other code parts.

An invisible button catches the focus instead of the
"All Tasks" row. Thanks to this button, unintended view
resets can be avoided when a focused widget is removed.

This fixes GitHub issue getting-things-gnome#1017
@diegogangl
Copy link
Contributor

LGTM, thanks for looking into this!
I'll mark the items on #1018 that are done

@diegogangl diegogangl merged commit dc0eb1a into getting-things-gnome:master May 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants