2
// Copyright (c) 2002 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
4
// Permission is hereby granted, free of charge, to any person obtaining a
5
// copy of this software and associated documentation files (the "Software"),
6
// to deal in the Software without restriction, including without limitation
7
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
// and/or sell copies of the Software, and to permit persons to whom the
9
// Software is furnished to do so, subject to the following conditions:
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
// DEALINGS IN THE SOFTWARE.
22
// $Id: Ewmh.hh 4038 2005-06-02 01:36:28Z mathias $
24
#include "AtomHandler.hh"
26
#include <X11/Xatom.h>
30
/// Implementes Extended Window Manager Hints ( http://www.freedesktop.org/Standards/wm-spec )
31
class Ewmh:public AtomHandler {
36
void initForScreen(BScreen &screen);
37
void setupFrame(FluxboxWindow &win);
38
void setupClient(WinClient &winclient);
40
void updateFocusedWindow(BScreen &screen, Window win);
41
void updateClientList(BScreen &screen);
42
void updateWorkspaceNames(BScreen &screen);
43
void updateCurrentWorkspace(BScreen &screen);
44
void updateWorkspaceCount(BScreen &screen);
45
void updateViewPort(BScreen &screen);
46
void updateGeometry(BScreen &screen);
47
void updateWorkarea(BScreen &screen);
49
void updateState(FluxboxWindow &win);
50
void updateLayer(FluxboxWindow &win);
51
void updateHints(FluxboxWindow &win);
52
void updateWorkspace(FluxboxWindow &win);
54
bool checkClientMessage(const XClientMessageEvent &ce,
55
BScreen * screen, WinClient * const winclient);
57
bool propertyNotify(WinClient &winclient, Atom the_property);
58
void updateFrameClose(FluxboxWindow &win);
60
void updateClientClose(WinClient &winclient);
63
void setFullscreen(FluxboxWindow &win, bool value);
67
typedef struct WindowState {
68
WindowState(int x, int y, unsigned int width, unsigned int height,
69
int layer, unsigned int decor);
71
unsigned int width, height, decor;
74
enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2};
76
void setState(FluxboxWindow &win, Atom state, bool value);
77
void toggleState(FluxboxWindow &win, Atom state);
79
void updateStrut(WinClient &winclient);
80
void setupState(FluxboxWindow &win);
82
// root window properties
83
Atom m_net_supported, m_net_client_list, m_net_client_list_stacking,
84
m_net_number_of_desktops, m_net_desktop_geometry, m_net_desktop_viewport,
85
m_net_current_desktop, m_net_desktop_names, m_net_active_window, m_net_workarea,
86
m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window;
88
// root window messages
89
Atom m_net_close_window, m_net_wm_moveresize;
91
// application window properties
92
Atom m_net_properties, m_net_wm_name, m_net_wm_desktop,
95
m_net_wm_window_type_dock,
96
m_net_wm_window_type_desktop,
99
m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded,
100
m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert,
101
m_net_wm_state_fullscreen,
102
m_net_wm_state_hidden,
103
m_net_wm_state_skip_taskbar,
104
m_net_wm_state_skip_pager,
105
m_net_wm_state_below,
106
m_net_wm_state_above,
109
m_net_wm_allowed_actions,
110
m_net_wm_action_move,
111
m_net_wm_action_resize,
112
m_net_wm_action_minimize,
113
m_net_wm_action_shade,
114
m_net_wm_action_stick,
115
m_net_wm_action_maximize_horz, m_net_wm_action_maximize_vert,
116
m_net_wm_action_fullscreen,
117
m_net_wm_action_change_desktop,
118
m_net_wm_action_close,
120
m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid,
121
m_net_wm_handled_icons;
123
// application protocols
128
std::vector<Window> m_windows;
129
typedef std::map<FluxboxWindow *, WindowState *> SavedState;
130
SavedState m_savedstate;
132
WindowState *getState(FluxboxWindow &win);
133
void clearState(FluxboxWindow &win);
134
void saveState(FluxboxWindow &win, WindowState *state);