static gboolean
propertyChanged (GtkWidget *widget, GdkEventProperty *event, GFramePeerData *data)
{
	awt_gtk_callbackEnter();

	if (event->atom == WM_STATE && event->state == GDK_PROPERTY_NEW_VALUE)
	{
		gint state = getWindowState(widget);

		if (state == ICONIC_STATE)
		{
			if (data->iconified == FALSE && GTK_WIDGET_VISIBLE(widget))
				postWindowIconified (data);

			data->iconified = TRUE;
		}

		else if (state == NORMAL_STATE)
		{
			if (data->iconified == TRUE && GTK_WIDGET_VISIBLE(widget))
				postWindowDeiconified (data);

			data->iconified = FALSE;
		}
	}

	awt_gtk_callbackLeave();

	return TRUE;
}
Exemple #2
0
/**
 * @brief rejects a window from beeing listed
 */
bool XfitMan::acceptWindow(Window window) const
{
    {
        AtomList types = getWindowType(window);
        AtomList ignoreList;
        ignoreList  << atom("_NET_WM_WINDOW_TYPE_DESKTOP")
                    << atom("_NET_WM_WINDOW_TYPE_DOCK")
                    << atom("_NET_WM_WINDOW_TYPE_SPLASH")
                    << atom("_NET_WM_WINDOW_TYPE_TOOLBAR")
                    << atom("_NET_WM_WINDOW_TYPE_MENU")
                    // for qlipper - using qpopup as a main window
                    << atom("_NET_WM_WINDOW_TYPE_POPUP_MENU");
        // issue #284: qmmp its not registered in window list panel
        // qmmp has _KDE_NET_WM_WINDOW_TYPE_OVERRIDE in its
        // _NET_WM_WINDOW_TYPE(ATOM) = _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _NET_WM_WINDOW_TYPE_NORMAL
        // Let's expect that _KDE_NET_WM_WINDOW_TYPE_OVERRIDE can be set for
        // regular windows too. If it should be hidden we should expect
        // one of atoms listed above.
//                    << atom("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");

        foreach (Atom i, ignoreList)
        {
            if (types.contains(i))
                return false;
        }

        WindowState state = getWindowState(window);
        if (state.SkipTaskBar)  return false;
    }

    Window transFor = None;
    // WM_TRANSIENT_FOR hint not set - normal window
    if (!XGetTransientForHint(QX11Info::display(), window, &transFor))
        return true;

    if (transFor == 0)      return true;
    if (transFor == window) return true;
    if (transFor == root)   return true;

     AtomList transForTypes = getWindowType(transFor);
     return !transForTypes.contains(atom("_NET_WM_WINDOW_TYPE_NORMAL"));
}
Exemple #3
0
bool XfitMan::requiresAttention(Window _wid) const
{
    return getWindowState(_wid).Attention;
}
Exemple #4
0
bool XfitMan::isHidden(Window _wid) const
{
    return getWindowState(_wid).Hidden;
}
Exemple #5
0
void KWM::prepareForSwallowing(Window w){
  XWithdrawWindow(qt_xdisplay(), w, qt_xscreen());
  while (getWindowState(w) != WithdrawnState);
}
bool Configuration::isHaveValidApplicationState()
{
    return (!getGeometryState().isEmpty())&&(!getWindowState().isEmpty());
}
Exemple #7
0
void Win32ToggleFullscreen( vout_thread_t *p_vout )
{
    HWND hwnd = (p_vout->p_sys->hparent && p_vout->p_sys->hfswnd) ?
        p_vout->p_sys->hfswnd : p_vout->p_sys->hwnd;

    /* Save the current windows placement/placement to restore
       when fullscreen is over */
    WINDOWPLACEMENT window_placement = getWindowState( hwnd );

    p_vout->b_fullscreen = ! p_vout->b_fullscreen;

    /* We want to go to Fullscreen */
    if( p_vout->b_fullscreen )
    {
        msg_Dbg( p_vout, "entering fullscreen mode" );

        /* Change window style, no borders and no title bar */
        int i_style = WS_CLIPCHILDREN | WS_VISIBLE;
        SetWindowLong( hwnd, GWL_STYLE, i_style );

        if( p_vout->p_sys->hparent )
        {
#ifdef UNDER_CE
            POINT point = {0,0};
            RECT rect;
            ClientToScreen( p_vout->p_sys->hwnd, &point );
            GetClientRect( p_vout->p_sys->hwnd, &rect );
            SetWindowPos( hwnd, 0, point.x, point.y,
                          rect.right, rect.bottom,
                          SWP_NOZORDER|SWP_FRAMECHANGED );
#else
            /* Retrieve current window position so fullscreen will happen
            *on the right screen */
            HMONITOR hmon = MonitorFromWindow(p_vout->p_sys->hparent,
                                            MONITOR_DEFAULTTONEAREST);
            MONITORINFO mi;
            if (GetMonitorInfo(hmon, &mi))
            SetWindowPos( hwnd, 0,
                            mi.rcMonitor.left,
                            mi.rcMonitor.top,
                            mi.rcMonitor.right - mi.rcMonitor.left,
                            mi.rcMonitor.bottom - mi.rcMonitor.top,
                            SWP_NOZORDER|SWP_FRAMECHANGED );
#endif
        }
        else
        {
            /* Maximize non embedded window */
            ShowWindow( hwnd, SW_SHOWMAXIMIZED );
        }

        if( p_vout->p_sys->hparent )
        {
            /* Hide the previous window */
            RECT rect;
            GetClientRect( hwnd, &rect );
            SetParent( p_vout->p_sys->hwnd, hwnd );
            SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
                          rect.right, rect.bottom,
                          SWP_NOZORDER|SWP_FRAMECHANGED );

#ifdef UNDER_CE
            HWND topLevelParent = GetParent( p_vout->p_sys->hparent );
#else
            HWND topLevelParent = GetAncestor( p_vout->p_sys->hparent, GA_ROOT );
#endif
            ShowWindow( topLevelParent, SW_HIDE );
        }

        SetForegroundWindow( hwnd );
    }
    else
    {
        msg_Dbg( p_vout, "leaving fullscreen mode" );
        /* Change window style, no borders and no title bar */
        SetWindowLong( hwnd, GWL_STYLE, p_vout->p_sys->i_window_style );

        if( p_vout->p_sys->hparent )
        {
            RECT rect;
            GetClientRect( p_vout->p_sys->hparent, &rect );
            SetParent( p_vout->p_sys->hwnd, p_vout->p_sys->hparent );
            SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
                          rect.right, rect.bottom,
                          SWP_NOZORDER|SWP_FRAMECHANGED );

#ifdef UNDER_CE
            HWND topLevelParent = GetParent( p_vout->p_sys->hparent );
#else
            HWND topLevelParent = GetAncestor( p_vout->p_sys->hparent, GA_ROOT );
#endif
            ShowWindow( topLevelParent, SW_SHOW );
            SetForegroundWindow( p_vout->p_sys->hparent );
            ShowWindow( hwnd, SW_HIDE );
        }
        else
        {
            /* return to normal window for non embedded vout */
            SetWindowPlacement( hwnd, &window_placement );
            ShowWindow( hwnd, SW_SHOWNORMAL );
        }

        /* Make sure the mouse cursor is displayed */
        PostMessage( p_vout->p_sys->hwnd, WM_VLC_SHOW_MOUSE, 0, 0 );
    }

    /* Update the object variable and trigger callback */
    var_SetBool( p_vout, "fullscreen", p_vout->b_fullscreen );
}