JDK-8212060: Found the problem - will try to fix
Kevin Rushforth
kevin.rushforth at oracle.com
Tue Apr 16 13:32:25 UTC 2019
I agree that gtk_widget_hide() --> gtk_window_move() -->
gtk_widget_show_all() is ugly.
Changing the shared code in com.sun.glass.ui.Window would need to be
done very carefully and tested on all platforms.
One other possibility, which I don't know if it is feasible, might be to
defer the call to focus if the window is not yet configured / shown for
the first time (assuming that this is really only problem the first time
it is shown).
Something like:
focus() {
if (window is already configured) {
request focus
} else {
deferredFocus = true
}
}
configure() {
configure / move the window
if (deferredFocus) {
request focus
deferredFocus = false
}
}
-- Kevin
On 4/16/2019 5:34 AM, Thiago Milczarek Sayao wrote:
> Yes, but I think it would require changes on com.sun.glass.ui.Window.
>
> - tsayao
> ________________________________
> De: Johan Vos <johan at lodgon.com>
> Enviado: terça-feira, 16 de abril de 2019 09:24
> Para: Thiago Milczarek Sayao
> Cc: openjfx-dev at openjdk.java.net
> Assunto: Re: JDK-8212060: Found the problem - will try to fix
>
> Would it be better to first have gtk_window_move and then request_focus?
>
> - Johan
>
> Op di 16 apr. 2019 om 14:15 schreef Thiago Milczarek Sayao <thiago.sayao at clamed.com.br<mailto:thiago.sayao at clamed.com.br>>:
> This bug affects Linux - the Window appears somewhere on the screen and then moves to de center. The moving is a visible glitch.
>
> * The cause *
>
> on glass_window.cpp:
>
> void WindowContextTop::request_focus() {
> gtk_window_present(GTK_WINDOW(gtk_widget));
> }
>
> This code executes before the gtk_window_move on WindowContextTop::window_configure.
>
> So there is the glitch - the window is presented and then moved (that's because the moving is vibile - may depend on the window manager).
>
> Posting here to hear suggestions on possible fixes.
>
> Calling gtk_widget_hide(), gtk_window_move() and then gtk_widget_show_all() fixes it - but it's ugly (in my opinion).
>
>
>
>
More information about the openjfx-dev
mailing list