<AWT Dev> Modal dialogs for fullscreen window

Vladimir Kravets vova.kravets at gmail.com
Tue Apr 16 06:29:36 PDT 2013

> I took a short look at your test at github. The test implements its own
mechanism to enter fullscreen by adding _NET_WM_STATE_FULLSCREEN to the
list of atoms in _NET_WM_STATE. There may be a conflict between
XToolkitand the test, for example, caused by using different Display

I agree with you but in this case I perform lock the awt thread by XToolkit.
awtLock()/XToolkit.awtUnlock() in the MinTest I forgot to do this, but if
you take a look on TestForm constructor this is doing it. Also Display is
closing when we finish our work. I do belive that should not be any
conflicts in this case.

As I said in the first email issue appeared in all of clones Metacity,
Gnome3 Shell (!!!) is also clone of the Metacity. I'm already check such
properties and they are set for 1.6 and 1.7 except one which you are not
mentioned here - _NET_WM_WINDOW_TYPE.
Java 1.6 is not set this atom to window, but 1.7 Java set this atom with
_NET_WM_WINDOW_TYPE_NORMAL value even this is dialog.... It seems that
Metacity's WMs have some strange behavior if _NET_WM_WINDOW_TYPE and
WM_TRANSIENT_FOR are set at the same time. Since _NET_WM_WINDOW_TYPE can be
only set or change before window was mapped by WM (see
http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6304176) we
don't have any workaround to fix this. Also is not clear why AWT always
sets _NET_WM_WINDOW_TYPE_NORMAL... On the same link we have such line:
_NET_WM_WINDOW_TYPE_NORMAL indicates that this is a normal, top-level
window, either managed or override-redirect. Managed windows with neither
_NET_WM_WINDOW_TYPE nor WM_TRANSIENT_FOR set MUST be taken as this type.
Override-redirect windows without _NET_WM_WINDOW_TYPE, must be taken as
this type, whether or not they have WM_TRANSIENT_FOR set.

Thus I understarding we don't need to set this always to
_NET_WM_WINDOW_TYPE_NORMAL only in case if we have specific type of window
(E.g. Splashscreen or Dialog) in this case we need to set specific type of
this window in this atom.

What you think about this?

2013/4/16 Artem Ananiev <artem.ananiev at oracle.com>

> Hi, Vladimir,
> I took a short look at your test at github. The test implements its own
> mechanism to enter fullscreen by adding _NET_WM_STATE_FULLSCREEN to the
> list of atoms in _NET_WM_STATE. There may be a conflict between XToolkit
> and the test, for example, caused by using different Display objects.
> In XToolkit, _NET_WM_STATE_FULLSCREEN is only used in exclusive fullscreen
> mode, see the code in X11GraphicsDevice. I can't say for sure if OpenGL is
> used in this case. As for owned windows, nothing special is done about
> them. If a window has an owner, WM_TRANSIENT_FOR is set for it, which
> should be respected by WM. As you say that WM_TRANSIENT_FOR works fine
> together with _NET_WM_STATE_FULLSCREEN in most of the modern WMs, it should
> work for Java windows as well.
> Could you check all the window properties both for the fullscreen window
> and for the child windows, in your environment, please? Are there any
> chances some of the properties (_NET_WM_STATE, WM_TRANSIENT_FOR) are not
> set for some reason?
> Thanks,
> Artem
> On 4/15/2013 8:56 PM, Vladimir Kravets wrote:
>> Hi guys,
>> I'm using in my application fullscreen mode. Since 1.6 java have a lot
>> of issue with it I using X11 native binding for it.
>> Use JNA 3.4. To going to fullscreen I send XSendEvent as _NET_WM_STATE
>> You can look at test application on the github:
>> https://github.com/vkravets/**FullScreenTest<https://github.com/vkravets/FullScreenTest>.
>> Main Class: Main or MinTest
>> So about the issue... I have an issue with modal dialogs or windows
>> which I try to show when my main window in fullscreen mode.
>>  From 1.7 java is not working as expected. In 1.6 java modal
>> dialogs/windows appeared above fullscreen window as it should be, but in
>> 1.7 and 1.8 all modal dialogs/windows appeared under the fullscreen
>> window.
>> I'm using wm Metacity, the same I have noticed on Gnome Shell... It
>> seems that it's related to all clones of Metacity...
>> I'm try to see how it's perform by defult native frameworks and I tested
>> GTK3 and SWT which is using GTK bindings. And everything is working as
>> expected. SmartGit which written on Java and use SWT don't have such
>> problem. VLC/GTK the same - in fullscreen mode I can call some dialogs
>> which will be appeared above fullscreen window.
>> It's very strange  for me that Java in own documentation have such lines:
>> Quote from GraphicsDevice#**setFullScreenWindow:
>> "
>> Windows cannot overlap the full-screen window. All other application
>> windows will always appear beneath the full-screen window in the Z-order.
>> "
>> Since from 1.7 java is using the same message _NET_WM_STATE with
>> _NET_WM_STATE_FULLSCREEN to going to fullscreeb and is not clear why we
>> have such broken behavior with modal dialogs from 1.7 java and such
>> lines in the documentation....
>> I'm already posted a defect to Oracle but Ithink it will be marked as
>> duplicate since I found such issue
>> http://bugs.sun.com/**bugdatabase/view_bug.do?bug_**id=7192269<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7192269>which marked
>> as Not an Issue and for me is not clear why?
>> Could you please suggest workaround? Or please fix this =)
>> Best Regards,
>> Vladimir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20130416/862cfa47/attachment.html 

More information about the awt-dev mailing list