Hi,

On 15.07.2014 23:54, Alexandros Diamantidis wrote:
> I've encountered a little problem with the pqiv image viewer:
> fullscreen doesn't work correctly in many cases. I submitted a bug
> report to pqiv's bug tracker and its author believes it's a problem with
> awesome, namely that windows requesting an aspect ratio not matching the
> screen before going fullscreen don't actually become full-screen.
> 
> Here's the bug report:
> 
> https://github.com/phillipberndt/pqiv/issues/27
> 
> His workaround is calling
> 
> gtk_window_set_geometry_hints(main_window, NULL, NULL, 0);
> 
> before going fullscreen.

>From the bug tracker, here is some simple python to reproduce the bug:

import gtk
w = gtk.Window()
w.connect("hide", gtk.main_quit)
w.show()
w.set_size_request(400, 600)
w.set_geometry_hints(min_aspect=1, max_aspect=1)
w.fullscreen()
gtk.main()

> Comments? Is this indeed an awesome bug, or maybe something that I could
> fix with some local configuration?

Nope, I don't think you can do anything against this.

I played around a little with xtrace. This tool analyzes all the X11 protocol
traffic and prints what the above python script is doing. In X11, a
ConfigureWindow request can be used to resize a window. A ConfigureNotify event
is received when the window really was resized (e.g. by the window manager or by
the program itself).

Here are all the relevant ConfigureWindow and ConfigureNotify events that occur
on the programs main window (0x02600003):

000:>:001c:32: Reply to InternAtom: atom=0x174("_NET_WM_STATE_FULLSCREEN")
(The fullscreen state has atom 0x174, this will be needed later)

000:>:00b7: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=0x0260001b x=0 y=0 width=200 height=200 border-width=0
override-redirect=false(0x00)
000:>:00bb: Event MapNotify(19) event=0x02600003 window=0x02600003
override-redirect=false(0x00)
(MapNotify means the window became visible aka "mapped". So it first becomes
visible with a size of 200x200 which fits with the above python code because the
w.show() happens so early)

000:<:00bd: 44: Request(25): SendEvent propagate=false(0x00)
destination=0x0000009d event-mask=SubstructureNotify,SubstructureRedirect
ClientMessage(33) format=0x20 window=0x02600003 type=0x171("_NET_WM_STATE")
data=0x01,0x00,0x00,0x00,0x74,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00;
(Yay for this ugly format. So this wants to add (first four bytes, value 1) the
property 0x174 (next four bytes, this is _NET_WM_STATE_FULLSCREEN as seen above)
to the window. So this is the point where the fullscreen() call happens.)

000:>:00be: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=None(0x00000000) x=0 y=0 width=1920 height=1060 border-width=0
override-redirect=false(0x00)
000:>:00be: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=None(0x00000000) x=0 y=22 width=1920 height=1060 border-width=0
override-redirect=false(0x00)
000:>:00be: Event (generated) ConfigureNotify(22) event=0x02600003
window=0x02600003 above-sibling=None(0x00000000) x=0 y=42 width=1920 height=1060
border-width=0 override-redirect=false(0x00)
000:>:00be: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=None(0x00000000) x=0 y=22 width=1920 height=1038 border-width=0
override-redirect=false(0x00)
000:>:00c0: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=None(0x00000000) x=0 y=0 width=1920 height=1080 border-width=0
override-redirect=false(0x00)
000:>:00c1: Event (generated) ConfigureNotify(22) event=0x02600003
window=0x02600003 above-sibling=None(0x00000000) x=0 y=0 width=1920 height=1080
border-width=0 override-redirect=false(0x00)
(Some resizing happens and awesome takes a while to finally position the window.
Because I am on a tiling layout, the window ends up in size 1920x1038 (my screen
size is 1920x1060))

000:>:00c1: Event PropertyNotify(28) window=0x02600003
atom=0x171("_NET_WM_STATE") time=0x00e637cb state=NewValue(0x00)
000:>:00c1: Event (generated) ConfigureNotify(22) event=0x02600003
window=0x02600003 above-sibling=None(0x00000000) x=0 y=0 width=1920 height=1080
border-width=0 override-redirect=false(0x00)
(Window becomes fullscreen and has the correct size)

000:<:00c8: 96: Request(18): ChangeProperty mode=Replace(0x00) window=0x02600003
property=0x28("WM_NORMAL_HINTS") type=0x29("WM_SIZE_HINTS")
data=0x00000290,0x00000000,0x00000000,0x00000000,0x00000000,0x00000190,0x00000258,0x00000000,0x00000000,0x00000000,0x00000000,0x00010000,0x00010000,0x00010000,0x00010000,0x00000000,0x00000000,0x00000001;
(The program changes its size hints. 0x190 is 400 in decimal and 0x258 is 600.
So the size request was just set. Why only now?!)

000:<:00e2: 96: Request(18): ChangeProperty mode=Replace(0x00) window=0x02600003
property=0x28("WM_NORMAL_HINTS") type=0x29("WM_SIZE_HINTS")
data=0x00000290,0x00000000,0x00000000,0x00000000,0x00000000,0x00000190,0x00000258,0x00000000,0x00000000,0x00000000,0x00000000,0x00010000,0x00010000,0x00010000,0x00010000,0x00000000,0x00000000,0x00000001;
000:<:00e3: 20: Request(12): ConfigureWindow window=0x02600003
values={width=1080 height=1080}
000:>:00e3: Event ConfigureNotify(22) event=0x02600003 window=0x02600003
above-sibling=None(0x00000000) x=0 y=0 width=1080 height=1102 border-width=0
override-redirect=false(0x00)
(The size hints (WM_SIZE_HINTS) are set again (why? Nothing changed?!) and the
program resizes itself(!!!) (= this isn't done by awesome) to size 1080x1080.
Awesome honors this and the window is resized to 1080x1102 (Uhm!?))


Summary:
Lots of weird stuff going on, but ultimately this is the program resizing itself
to this weird size in an attempt to enforce its size hints. At least I can't
really see what awesome is doing wrong.

Cheers,
Uli
-- 
A learning experience is one of those things that say,
'You know that thing you just did? Don't do that.'
                     -- Douglas Adams

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to