diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index a8b126cb91..675cef07d8 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -503,6 +503,43 @@ typedef enum _Ecore_X_Window_Input_Mode { ECORE_X_WINDOW_INPUT_MODE_ACTIVE_GLOBAL } Ecore_X_Window_Input_Mode; +typedef enum _Ecore_X_Window_State { + /** The window is a modal dialog box. */ + ECORE_X_WINDOW_STATE_MODAL, + + /** The window manager should keep the window's position fixed + * even if the virtual desktop scrolls. */ + ECORE_X_WINDOW_STATE_STICKY, + + /** The window has the maximum vertical size. */ + ECORE_X_WINDOW_STATE_MAXIMIZED_VERT, + + /** The window has the maximum horizontal size. */ + ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ, + + /** The window is shaded. */ + ECORE_X_WINDOW_STATE_SHADED, + + /** The window should not be included in the taskbar. */ + ECORE_X_WINDOW_STATE_SKIP_TASKBAR, + + /** The window should not be included in the pager. */ + ECORE_X_WINDOW_STATE_SKIP_PAGER, + + /** The window is invisible (i.e. minimized/iconified) */ + ECORE_X_WINDOW_STATE_HIDDEN, + + /** The window should fill the entire screen and have no + * window border/decorations */ + ECORE_X_WINDOW_STATE_FULLSCREEN, + + /* The following are not documented because they are not + * intended for use in applications. */ + ECORE_X_WINDOW_STATE_ABOVE, + ECORE_X_WINDOW_STATE_BELOW + +} Ecore_X_Window_State; + int ecore_x_init(const char *name); int ecore_x_shutdown(void); Ecore_X_Display *ecore_x_display_get(void); @@ -574,6 +611,9 @@ void ecore_x_window_prop_window_type_utility_set(Ecore_X_Window win) void ecore_x_window_prop_window_type_splash_set(Ecore_X_Window win); void ecore_x_window_prop_window_type_dialog_set(Ecore_X_Window win); void ecore_x_window_prop_window_type_normal_set(Ecore_X_Window win); +void ecore_x_window_prop_state_set(Ecore_X_Window win, Ecore_X_Window_State s); +int ecore_x_window_prop_state_isset(Ecore_X_Window win, Ecore_X_Window_State s); +void ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s); void ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask); diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_window_prop.c b/legacy/ecore/src/lib/ecore_x/ecore_x_window_prop.c index 37d6befbf6..8969e28a73 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_window_prop.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_window_prop.c @@ -801,7 +801,7 @@ ecore_x_window_prop_desktop_get(Ecore_X_Window win) } /** - * Change a windows type. + * Change a window's type. * @param win The Window * @param type The Type * @@ -830,6 +830,152 @@ ecore_x_window_prop_window_type_set(Ecore_X_Window win, Ecore_X_Atom type) free(data); } +static Ecore_X_Atom +_ecore_x_window_prop_state_atom_get(Ecore_X_Window_State s) +{ + switch(s) + { + case ECORE_X_WINDOW_STATE_MODAL: + return _ecore_x_atom_net_wm_state_modal; + case ECORE_X_WINDOW_STATE_STICKY: + return _ecore_x_atom_net_wm_state_sticky; + case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT: + return _ecore_x_atom_net_wm_state_maximized_vert; + case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ: + return _ecore_x_atom_net_wm_state_maximized_horz; + case ECORE_X_WINDOW_STATE_SHADED: + return _ecore_x_atom_net_wm_state_shaded; + case ECORE_X_WINDOW_STATE_SKIP_TASKBAR: + return _ecore_x_atom_net_wm_state_skip_taskbar; + case ECORE_X_WINDOW_STATE_SKIP_PAGER: + return _ecore_x_atom_net_wm_state_skip_pager; + case ECORE_X_WINDOW_STATE_HIDDEN: + return _ecore_x_atom_net_wm_state_skip_pager; + case ECORE_X_WINDOW_STATE_FULLSCREEN: + return _ecore_x_atom_net_wm_state_fullscreen; + case ECORE_X_WINDOW_STATE_ABOVE: + return _ecore_x_atom_net_wm_state_above; + case ECORE_X_WINDOW_STATE_BELOW: + return _ecore_x_atom_net_wm_state_below; + default: + return 0; + } +} + +/** + * Set a state for a window + * @param win The Window whose properties will be changed + * @param s The state to be set for this window + * + * Adds the state to the window's properties if not already included. + *