-
Notifications
You must be signed in to change notification settings - Fork 167
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
Auto-close current task window when opening parent task (as Task Editor utility windows focus but don't raise when "presented" on X11/Xorg GNOME session) #326
Comments
I've pushed a commit to a branch of mine at https://github.com/nekohayo/GTG/commits/task_editor_window_management that addresses the "open/create parent" part of this issue, however to be consistent I think it should also close the parent when you click the hyperlink of a subtask; however I was not able to find what code method handles the clicks onto subtask hyperlinks, maybe @diegogangl would know? |
For the 2nd part, in taskview.py I found the methods for entering subtask links, "_tag_event" (pretty badly named, no mention of clicking or anything, so it took me a good while to find this!) and "_keypress"... which have something like this (print additions mine):
So theoretically that's where the magic happens, but I can't figure out how to access the TaskEditor instance/object/window from within TaskView, to be able to tell the existing TaskEditor to close after opening the subtask... |
You can't access the app from the taskview, The problem is that you don't have a way to distinguish between opening subtasks and opening tasks in general at the level of Also, remember everything in taskview.py is getting the axe :) |
OK, in that case, what do you think about the proposed approach here (closing task editor windows automatically as much as possible), if you like it then I could merge that commit as it currently stands, and then we keep/retarget this ticket for "after the taskview refactoring" for the subtasks part? |
Nah, it's only going to be a few lines of conflict. Go ahead! |
This solves some window management issues on X11/Xorg, reduces visual clutter, and overall saves some work for users. Related to GitHub issue #326
This solves some window management issues on X11/Xorg, reduces visual clutter, and overall saves some work for users. Related to GitHub issue getting-things-gnome#326
When we changed the Task Editor's window "type hint" to "utility" in issue #89 and #266, we created the following symptom: when running in a X11/Xorg GNOME session, if you click the "Open Parent" (or "Add Parent") button in a task, the newly opened task window shows up, gets focused, but shows up behind the existing task editor window, and the user has to click that newly created window's titlebar to actually see the contents and interact with it. But it turns out, this issue does not occur when running a Wayland GNOME session.
So I went into a bit of a rabbit hole trying to "fix" that... and it seems to be impossible. I thought it was because we were using window.present() instead of window.present_with_time(time.time()), but not only does this approach not work either, it seems we would be at the mercy of a window managers in the future. Here's a chat I had on IRC:
...and then, it occurred to me that I'm trying to put a band-aid on the problem, while there is a more elegant and "useful" solution: closing the current window when opening the new window. Whether I want to open (or create) a parent task, or open a child task (by clicking one of the subtasks hyperlinks), it's pointless to keep the old window open at the same time, and it creates potential out-of-sync issues like #38. By closing the window, this would reduce clutter for the user, and if entering a child task this way, they can always go back to the parent task easily thanks to the existence of the new "Open Parent" button.
I have hacked around the code to prove to myself that it would work, and it does. It solves my window management issues and it doesn't feel unnatural from a UI perspective. So I'll clean up my code hacks and provide a clean patch/commit for this to be reviewed & tested. This might also reduce a bit the need for #275.
The text was updated successfully, but these errors were encountered: