static void uiVideoMouse( int Button,int X,int Y,int RX,int RY ) { static int mplVideoMoved = 0; static int msButton = 0; uiPlaybarShow( Y ); switch( Button ) { case wsRRMouseButton: gtkShow( ivShowPopUpMenu,NULL ); break; case wsPMMouseButton: gtkShow( ivHidePopUpMenu,NULL ); uiMenuShow( RX,RY ); msButton=wsPMMouseButton; break; case wsRMMouseButton: uiMenuHide( RX,RY,1 ); msButton=0; break; /* --- */ case wsPLMouseButton: gtkShow( ivHidePopUpMenu,NULL ); sx=X; sy=Y; msButton=wsPLMouseButton; mplVideoMoved=0; break; case wsMoveMouse: switch ( msButton ) { case wsPLMouseButton: mplVideoMoved=1; if ( !guiApp.videoWindow.isFullScreen ) { wsWindowMove( &guiApp.videoWindow,True,RX - sx,RY - sy ); } break; case wsPMMouseButton: if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 ); break; default: uiPlaybarShow( Y ); break; } break; case wsRLMouseButton: if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) ) { // NOTE TO MYSELF: this doesn't work, fix later with wsWindowLayer()? if( videoVisible++%2 ) wsWindowRaiseTop( wsDisplay,guiApp.mainWindow.WindowID ); else wsWindowRaiseTop( wsDisplay,guiApp.videoWindow.WindowID ); } msButton=0; mplVideoMoved=0; break; } }
/** * @brief Switch window fullscreen state. * * Switch normal window to fullscreen and fullscreen window to normal. * * @param win pointer to a ws window structure */ void wsWindowFullscreen(wsWindow *win) { if (win->isFullScreen) { if (vo_fs_type & vo_wm_FULLSCREEN) /* window manager supports EWMH */ vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_REMOVE); else { win->X = win->OldX; win->Y = win->OldY; win->Width = win->OldWidth; win->Height = win->OldHeight; } win->isFullScreen = False; } else { if (vo_fs_type & vo_wm_FULLSCREEN) /* window manager supports EWMH */ vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_ADD); else { win->OldX = win->X; win->OldY = win->Y; win->OldWidth = win->Width; win->OldHeight = win->Height; } win->isFullScreen = True; wsWindowUpdateXinerama(win); } /* unknown window manager and obsolete option -fsmode used */ if (vo_wm_type == 0 && !(vo_fsmode & 16)) { XUnmapWindow(wsDisplay, win->WindowID); // required for MWM XWithdrawWindow(wsDisplay, win->WindowID, wsScreen); } /* restore window if window manager doesn't support EWMH */ if (!(vo_fs_type & vo_wm_FULLSCREEN)) { if (!win->isFullScreen) wsWindowDecoration(win); wsWindowSizeHint(win); wsWindowLayer(wsDisplay, win->WindowID, win->isFullScreen); XMoveResizeWindow(wsDisplay, win->WindowID, win->X, win->Y, win->Width, win->Height); } /* some window managers lose ontop after fullscreen */ if (!win->isFullScreen & vo_ontop) wsWindowLayer(wsDisplay, win->WindowID, vo_ontop); wsWindowRaiseTop(wsDisplay, win->WindowID); XFlush(wsDisplay); }
void uiMenuShow( int mx,int my ) { int x,y; if ( !guiApp.menuIsPresent ) return; x=mx; if ( x + guiApp.menuWindow.Width > wsMaxX ) x=wsMaxX - guiApp.menuWindow.Width - 1 + wsOrgX; y=my; if ( y + guiApp.menuWindow.Height > wsMaxY ) y=wsMaxY - guiApp.menuWindow.Height - 1 + wsOrgY; menuX=x; menuY=y; menuItem = 0; wsWindowMove( &guiApp.menuWindow,True,x,y ); wsWindowRaiseTop( wsDisplay,guiApp.menuWindow.WindowID ); wsWindowLayer( wsDisplay,guiApp.menuWindow.WindowID,1 ); uiMenuRender=True; wsWindowVisibility( &guiApp.menuWindow,wsShowWindow ); wsWindowRedraw( &guiApp.menuWindow ); }
/** * @brief Activate a GTK window, i.e. raise it to the top. * * @param window pointer to a GtkWindow widget */ void gtkRaise(GtkWidget *window) { wsWindowRaiseTop(gdk_display, GDK_WINDOW_XWINDOW(window->window)); }