After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 516822 - gtk_window_fullscreen does not resize correctly if removing widgets
gtk_window_fullscreen does not resize correctly if removing widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.12.x
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-02-16 10:57 UTC by Czirkos Zoltan
Modified: 2011-11-10 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (1.32 KB, text/plain)
2008-03-15 16:31 UTC, Czirkos Zoltan
Details
fullscreened app, still start menu visible (13.51 KB, image/png)
2008-03-15 16:32 UTC, Czirkos Zoltan
Details

Description Czirkos Zoltan 2008-02-16 10:57:44 UTC
Please describe the problem:
I have an application, which makes its menu bar and tool bar invisible, when in fullscreen mode. This works on linux, but in win32, the size of the window is not fullscreen, and the taskbar remains visible.

Steps to reproduce:
1. gtk_window_fullscreen(window);
2. gtk_widget_hide(toolbar);

or hiding first then fullscreen, the same happens.


Actual results:
not fullscreened correctly; window does not have title bar, and is maximized horizontally, but only 98% size vertically and taskbar visible.

Expected results:
fullscreen app.


Does this happen every time?
yes

Other information:
can be worked around the following way:

gboolean fs_func(gpointer data)
{
   gtk_window_fullscreen(window);
   return FALSE;
}

...
gtk_widget_hide(toolbar);
g_idle_add_full(G_PRIORITY_LOW, fs_func, NULL, NULL);



so maybe some gtk-internal configure/windowstate event should handle if the content of the window changes. my app does not connect to either of these or similar events.
Comment 1 Tor Lillqvist 2008-03-10 17:49:51 UTC
Could you please provide a minimal but complete sample program as an attachment (just a single C file), thanks!
Comment 2 Czirkos Zoltan 2008-03-15 16:31:30 UTC
Created attachment 107344 [details]
testcase
Comment 3 Czirkos Zoltan 2008-03-15 16:32:41 UTC
Created attachment 107345 [details]
fullscreened app, still start menu visible
Comment 4 Czirkos Zoltan 2008-09-15 09:08:52 UTC
The same happens for gtk_window_maximize on win32.
Comment 5 Zac Luzader 2008-11-07 16:57:54 UTC
I am getting this too.
winxp, pygtk 2.12.1, gtk 2.14.4

Note that the same thing happens whether you hide the widget when calling fullscreen(), or if you hide the widget inside a window_state_change callback. 

The workaround the reporter has indeed works in my case too. i.e.:
 self.menubar.hide()
 gobject.idle_add(self.fullscreen) #hack to workaround bug #516822

<mytwocents>
In win32 (not gtk specifically), setting a maximized window's size, even to the same as the existing size, can do funny things like what i'm seeing. Maybe this is what gtk is doing when it reallocates after hiding a widget. (Hope that helps somebody, but it probably won't.)
</mytwocents>
Comment 6 Zac Luzader 2009-03-22 07:39:21 UTC
I've found that the idle_add workaround isn't very good, as it simply avoids doing a hide/show/add/pack/etc. while fullscreened. My app needs to do these while fullscreened. After looking at this again I have found a much more robust workaround. This code works on win32 with gtk 2.16.0 (I have not tried this on other platforms or older gtk versions):

    def toggle_fullscreen(self):        
        if self.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN:
            self.menubar.show()                      
            self.unfullscreen()            
            self.set_decorated(True) 
        else:
            self.menubar.hide()
            self.set_decorated(False)
            self.fullscreen()
            #or you can menubar.hide here.

The order of set_decorated and fullscreen, as well as set_decorated and unfullscreen appears to be critical. However one can safely hide the menubar after fullscreening without breaking the fullscreen as described in the report.
Comment 7 Laguillaumie sylvain 2011-08-21 19:45:27 UTC
hi

with same code and pygtk 2.22 same thing happen on win32, ok on linux

screencast attached

thanks
Comment 8 Laguillaumie sylvain 2011-08-21 19:51:22 UTC
(In reply to comment #7)
> hi
> 
> with same code and pygtk 2.22 same thing happen on win32, ok on linux
> 
> screencast attached
> 
> thanks

sorry...

screencast here:

http://www.penguincape.org/downloads/smo/fullscreen_problem_win32.ogv

you can see that set_decorated true/false do not work normally

thanks !
Comment 9 Alexander Larsson 2011-11-10 18:13:48 UTC
Fixed in gtk-2-24 branch, will be in 2.24.8 release.