Re: full screen, no decor...how?



I want to create a toplevel window to be full-screen, with NO window manager
frame or decoration (ie no CLOSE, MINIMISE etc buttons).

This is a direct cut and paste from my own code (which
admitedly needs some reviewing), so with this code
when the user presses Escape the current window goes
fullscreen (to make photographs from the screen, for example),
when she/he presses Escape again the former window appears, 
with its original size and position.

Please note that I have my own window objects, so window->window
is actually a gtk window and window->window->window is a gdk window.
I allow users to hide/show the various menus, so I need to keep
flags to save their status, in your case these tests should always
be true (i.e. hide all menus when going full screen and show
all of them again when you restore the original window).

Carlos

case GDK_Escape:
  if (key_Escape == 1)
    {
    gdk_window_get_size (window->window->window, &window->w, &window->h);
    gdk_window_get_origin (window->window->window, &window->x, &window->y);
    gdk_window_raise (window->window->window);
    gdk_window_move_resize (window->window->window, 0, 0,
    gdk_screen_width(), gdk_screen_height());
    if (window->top_flag == 1) gtk_widget_hide (window->top);
    if (window->medium_flag == 1) gtk_widget_hide (window->medium);
    if (window->bottom_flag == 1) gtk_widget_hide (window->bottom);
    }
  else
    {
    gdk_window_move_resize (window->window->window, window->x,
    window->y, window->w, window->h);
    if (window->top_flag == 1) gtk_widget_show (window->top);
    if (window->medium_flag == 1) gtk_widget_show (window->medium);
    if (window->bottom_flag == 1) gtk_widget_show (window->bottom);
    }
  key_Escape *= -1;
  break;




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