void playerWindow::on_fullscreen_clicked ( void ) { // hide all useless stuff for fullscreen mode menubar->set_visible(!menubar->get_visible()); borderleft->set_visible(!borderleft->get_visible()); borderright->set_visible(!borderright->get_visible()); // show/hide window decoration set_decorated(!get_decorated()); // switch between the fullscreen and the unfullscreen button unfullscreenBtn->set_visible(!unfullscreenBtn->get_visible()); fullscreenBtn->set_visible(!fullscreenBtn->get_visible()); // switch between fullscreen and a decorated window (get_decorated()) ? unmaximize () : maximize (); (get_decorated()) ? unfullscreen() : fullscreen(); // set the fullscreen state isFullscreen = !isFullscreen; /* Call timeout function at a 3000ms interval to hide or show player controls when it is in fullscreen mode. When the window is no more in the fullscreen mode, timeout signals are disconnected motion detector */ if (isFullscreen) { // set the timer to call periodically the timeout function timeout_fullscreen = Glib::signal_timeout().connect ( sigc::mem_fun ( *this, &playerWindow::on_timeout_fullscreen ), 3000 ); // set a motion detector into the drawing area mouse_motion_signal_drawingArea = videoDrawingArea->signal_motion_notify_event().connect ( sigc::mem_fun ( *this, &playerWindow::on_mousemove ) ); /* set the focus into the drawing area. Without the focus, the motion detection doesn't occurs when a movie is playing*/ videoDrawingArea->set_can_focus ( !videoDrawingArea->get_can_focus() ); // next trigger to attempt to hide the mediaplayer controler nextmotiondetection = time(NULL)+3; } else { // disconnect signals timeout_fullscreen.disconnect() ; mouse_motion_signal_drawingArea.disconnect(); // remove the focus videoDrawingArea->set_can_focus(!videoDrawingArea->get_can_focus()); } }
void toggle_fullscreen(int signum) { if(gtk_window_get_decorated(GTK_WINDOW(window))) { maximize(); } else { unmaximize(); } }
void jobManWindow::setPosition() { if (positionValid) { resize(size_width, size_height); move(pos_x, pos_y); if (isMaximized) { maximize(); } else { unmaximize(); } } else { resize(640 * 1.5, 400 * 1.5); set_position(Gtk::WIN_POS_CENTER); } }