Re: [gtk-list] Re: Root & fullscreen windows



david wrote:

> I've tried what you told me. This works to make
> a fullscreen window but then i can't restore
> the saved geometry  of the window.
>
> Here's the code :
>
> typedef struct _MyWidget {
>         GtkWidget *w;
>         gint ww, wh, wx, wy;
> } MyWidget;
>
> /* w->ww is always equal to 0 the first
>    time this function is called */
> void
> toggle_fullscreen( MyWidget *w) {
>   GtkWidget *top;
>
>   if ( !GTK_WIDGET_VISIBLE( w->w))
>     return;
>
>   top = gtk_widget_get_toplevel( w->w);
>
>   if ( w->ww) {
>     /* restore the saved window geometry */
>     gtk_widget_set_usize( top, w->ww, w->wh);
>     gtk_widget_set_uposition( top, w->wx, w->wy);
>
>     w->ww = 0;
>
>   } else {
>     /* make the window fullscreen */
>
>     /* save the window geomtry */
>     w->wx = top->allocation.x;
>     w->wy = top->allocation.y;
>     w->ww = top->allocation.width;
>     w->wh = top->allocation.height;
>
>     gtk_widget_set_uposition( top, 0, 0);
>     gtk_widget_set_usize( top, gdk_screen_width(),
>                           gdk_screen_height());
>
> }
>

Hm.. Strange...looks fine to me

> Any idea why this don't work ?
>
> Thanks
>
> david
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]