Tryton - Issues

 

Issue8061

Title Set focus on first entry of filter window
Priority bug Status resolved
Superseder Nosy List ced, mrichez, reviewbot, roundup-bot, tbruyere
Type behavior Components tryton
Assigned To ced Keywords review
Reviews 48711002
View: 48711002

Created on 2019-01-30.23:56:06 by ced, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
2019-02-11-231616_970x776_scrot.png ced, 2019-02-11.23:18:06 image/png
Messages
New changeset 292dc08e7d00 by Cédric Krier in branch 'default':
Replace filter window by popover
https://hg.tryton.org/tryton-env/rev/292dc08e7d00
New changeset d1b442b6c85e by Cédric Krier in branch 'default':
Replace filter window by popover
https://hg.tryton.org/tryton/rev/d1b442b6c85e
msg47052 (view) Author: [hidden] (mrichez) Date: 2019-02-15.10:00:01
Super! Focus is now correct on first search field :-) LGTM
review48711002 updated at https://codereview.tryton.org/48711002/#ps80001
review48711002 updated at https://codereview.tryton.org/48711002/#ps60001
review48711002 updated at https://codereview.tryton.org/48711002/#ps40001
msg46953 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-02-11.23:18:06
I updated review48711002 to use Popover. It should work on any WM now.
I put also a screenshot of how it looks.
msg46951 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-02-11.19:53:46
I think the solution is to use a Popover [1]. This widget did not exist in GTK+2 and what we tried to do with the filter window is indeed what Popover solved.

[1] https://developer.gnome.org/gtk3/stable/GtkPopover.html
msg46725 (view) Author: [hidden] (tbruyere) Date: 2019-02-04.12:06:07
I tested on desktop environment next :

Fedora with KDE - Kwin : Ok the behavior is good
Fedora with MATE - Metacity : Ok the behavior is good
Fedora with GNOME - Gnome-shell : NOK the focus is not set on the first entry
Manjaro with XFCE - Xfwm4 : NOK the focus is not set on the first entry

it's a behavior problem with the window manager but not only gnome-shell.

But I can not understand the different behavior.
msg46671 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.21:15:48
Maybe to temper the problem on Ubuntu, we could hide the filter window when switching tab.
msg46668 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.17:09:25
Well I think the Ubuntu WM is not the best choice. It is known to break behavior (like with the top menu bar).
I'm pretty sure it is because it force the focus to stay under the cursor.
msg46667 (view) Author: [hidden] (tbruyere) Date: 2019-01-31.16:54:47
I have installed a Ubuntu 18.04 LTS.
I only install tryton GTK Client with pip3 install tryton (5.0.5)
I connect to demo5.0.tryton.org and I have the same behaviour. 
The focus is not on the first text entry.
msg46665 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.15:46:45
There seems to be something wrong with your window manager. The code ask to put the focus and cursor on the window and the WM does not do it. I do not see what we can do more.
msg46663 (view) Author: [hidden] (mrichez) Date: 2019-01-31.15:11:49
With search_window.present() if i click twice on the button to display the search popup then first field has focus.
msg46662 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.15:09:56
I do not have any problem on any OS I tries.
msg46661 (view) Author: [hidden] (mrichez) Date: 2019-01-31.15:02:24
Not working... 
Tested also with Manjaro and XFCE but no focus.
Have you the same problem with your linux distribution?
review48711002 updated at https://codereview.tryton.org/48711002/#ps20001
msg46659 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.14:24:29
In last version, I replaced the show call by present.
msg46658 (view) Author: [hidden] (tbruyere) Date: 2019-01-31.12:55:25
I have tested with GTK 3.24.3 and gnome/mutter on Manjaro and I have the same behavior.
The focus is not set on the entry field.
But I have tested with GTK Client 5.0.5 on Windows 10 PRO. It's working even without patch.
msg46656 (view) Author: [hidden] (mrichez) Date: 2019-01-31.10:19:33
Will check with another linux distribution. 
It's just the grab_focus that seems not working. Because i made a test with a 'entry.set_text('TEST')' and it's correctly displaying value on the first entry field. But i have to click on this entry to have focus...
msg46655 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-31.10:15:44
It is very strange. Is it possible that it is because you have a very old GTK version or a particular window manager.
msg46654 (view) Author: [hidden] (mrichez) Date: 2019-01-31.09:13:38
Don't change anything on Debian 9. No focus on the first entry field.
review48711002 updated at https://codereview.tryton.org/48711002/#ps1
msg46652 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-01-30.23:56:05
From https://discuss.tryton.org/t/improve-search-filter-on-client/1093/6
The focus is not always set on the filter window. Because grab_focus is called on the window which can not have the focus. So the behavior relies on the window manager to set or not the focus.
History
Date User Action Args
2019-02-26 15:50:44roundup-botsetmessages: + msg47211
2019-02-26 15:50:43roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg47210
2019-02-15 10:00:01mrichezsetmessages: + msg47052
2019-02-12 01:44:11reviewbotsetmessages: + msg46956
2019-02-12 01:06:25reviewbotsetmessages: + msg46955
2019-02-11 23:41:03reviewbotsetmessages: + msg46954
2019-02-11 23:18:07cedsetstatus: in-progress -> testing
files: + 2019-02-11-231616_970x776_scrot.png
messages: + msg46953
2019-02-11 19:53:46cedsetstatus: testing -> in-progress
messages: + msg46951
2019-02-04 12:06:08tbruyeresetmessages: + msg46725
2019-01-31 21:15:48cedsetmessages: + msg46671
2019-01-31 17:09:25cedsetmessages: + msg46668
2019-01-31 16:54:48tbruyeresetmessages: + msg46667
2019-01-31 15:46:45cedsetmessages: + msg46665
2019-01-31 15:11:49mrichezsetmessages: + msg46663
2019-01-31 15:09:56cedsetmessages: + msg46662
2019-01-31 15:02:25mrichezsetmessages: + msg46661
2019-01-31 14:37:38reviewbotsetmessages: + msg46660
2019-01-31 14:24:29cedsetmessages: + msg46659
2019-01-31 12:55:25tbruyeresetnosy: + tbruyere
messages: + msg46658
2019-01-31 10:19:33mrichezsetmessages: + msg46656
2019-01-31 10:15:45cedsetmessages: + msg46655
2019-01-31 09:13:38mrichezsetnosy: + mrichez
messages: + msg46654
2019-01-31 00:12:58reviewbotsetnosy: + reviewbot
messages: + msg46653
2019-01-30 23:58:45cedsetstatus: in-progress -> testing
reviews: 48711002
keyword: + review
2019-01-30 23:56:06cedcreate