예제 #1
0
파일: ws.c 프로젝트: jlelli/mplayer-dl
/**
 * @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);
}
예제 #2
0
파일: actions.c 프로젝트: 0p1pp1/mplayer
/**
 * @brief Switch video window fullscreen mode.
 *
 *        Switch normal video to fullscreen and fullscreen video to normal.
 */
void uiFullScreen(void)
{
    if (!guiInfo.VideoWindow)
        return;

    wsWindowFullscreen(&guiApp.videoWindow);

    vo_fs = guiApp.videoWindow.isFullScreen;

    wsWindowLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen);

    if (guiApp.menuIsPresent)
        wsWindowLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen);
}
예제 #3
0
파일: menu.c 프로젝트: 0p1pp1/mplayer
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 );
}
예제 #4
0
파일: dialog.c 프로젝트: 0p1pp1/mplayer
/**
 * @brief Set the layer for a GTK window.
 *
 * @param window pointer to a GtkWindow widget
 */
void gtkSetLayer(GtkWidget *window)
{
    wsWindowLayer(gdk_display, GDK_WINDOW_XWINDOW(window->window), guiApp.videoWindow.isFullScreen);
    gtkRaise(window);
}
예제 #5
0
파일: actions.c 프로젝트: 0p1pp1/mplayer
/**
 * @brief Change to a different skin.
 *
 * @param name name of the skin to change to
 */
void uiChangeSkin(char *name)
{
    int was_menu, was_playbar;

    was_menu    = guiApp.menuIsPresent;
    was_playbar = guiApp.playbarIsPresent;

    mainVisible = False;

    if (skinRead(name) != 0) {
        if (skinRead(skinName) != 0) {
            gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_SkinCfgError, skinName);
            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
        }
    }

    /* reload main window (must be first!) */

    uiMainDone();
    uiMainInit();

    wsWindowVisibility(&guiApp.mainWindow, wsShowWindow);
    mainVisible = True;

    /* adjust video window */

    if (guiApp.video.Bitmap.Image) {
        wsImageResize(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height);
        wsImageRender(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
    }

    if (!guiInfo.Playing) {
        if (!guiApp.videoWindow.isFullScreen) {
            wsWindowResize(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height);
            wsWindowMove(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y);
        }

        wsWindowRedraw(&guiApp.videoWindow);
    }

    /* reload playbar */

    if (was_playbar)
        uiPlaybarDone();

    uiPlaybarInit();

    /* reload menu window */

    if (was_menu)
        uiMenuDone();

    uiMenuInit();

    /* */

    if (guiInfo.AudioPassthrough)
        btnSet(evSetVolume, btnDisabled);
    if (guiInfo.AudioChannels < 2 || guiInfo.AudioPassthrough)
        btnSet(evSetBalance, btnDisabled);

    btnSet(evFullScreen, guiApp.videoWindow.isFullScreen ? btnPressed : btnReleased);

    wsWindowLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen);
    wsWindowLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen);
}