diff options
author | akir <akir> | 2004-10-18 01:26:54 (GMT) |
---|---|---|
committer | akir <akir> | 2004-10-18 01:26:54 (GMT) |
commit | 496d73d89994d868f5dc45a5ea6cefe40a74f148 (patch) | |
tree | f8a9b4102403e4d58082d17d7dbc406ea3360f81 /src/fluxbox.hh | |
parent | 2760b03b2e0a7ee93e4ce70daf73faa609076dff (diff) | |
download | fluxbox_pavel-496d73d89994d868f5dc45a5ea6cefe40a74f148.zip fluxbox_pavel-496d73d89994d868f5dc45a5ea6cefe40a74f148.tar.bz2 |
rewritten fluxbox-restart code, all destructors are called before the
new program is started. the former method didnt do that.
Diffstat (limited to 'src/fluxbox.hh')
-rw-r--r-- | src/fluxbox.hh | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 0b67b44..021619b 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.hh,v 1.92 2004/10/10 16:06:24 akir Exp $ | 25 | // $Id: fluxbox.hh,v 1.93 2004/10/18 01:26:54 akir Exp $ |
26 | 26 | ||
27 | #ifndef FLUXBOX_HH | 27 | #ifndef FLUXBOX_HH |
28 | #define FLUXBOX_HH | 28 | #define FLUXBOX_HH |
@@ -83,7 +83,7 @@ public: | |||
83 | Fluxbox(int argc, char **argv, const char * dpy_name= 0, | 83 | Fluxbox(int argc, char **argv, const char * dpy_name= 0, |
84 | const char *rcfilename = 0); | 84 | const char *rcfilename = 0); |
85 | virtual ~Fluxbox(); | 85 | virtual ~Fluxbox(); |
86 | 86 | ||
87 | static Fluxbox *instance() { return s_singleton; } | 87 | static Fluxbox *instance() { return s_singleton; } |
88 | /// main event loop | 88 | /// main event loop |
89 | void eventLoop(); | 89 | void eventLoop(); |
@@ -98,7 +98,7 @@ public: | |||
98 | WinClient *searchWindow(Window); | 98 | WinClient *searchWindow(Window); |
99 | inline WinClient *getFocusedWindow() { return m_focused_window; } | 99 | inline WinClient *getFocusedWindow() { return m_focused_window; } |
100 | 100 | ||
101 | 101 | ||
102 | BScreen *searchScreen(Window w); | 102 | BScreen *searchScreen(Window w); |
103 | 103 | ||
104 | inline unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; } | 104 | inline unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; } |
@@ -138,7 +138,7 @@ public: | |||
138 | inline int getNum() const { return m_num; } | 138 | inline int getNum() const { return m_num; } |
139 | 139 | ||
140 | Layer &operator=(int num) { m_num = num; return *this; } | 140 | Layer &operator=(int num) { m_num = num; return *this; } |
141 | 141 | ||
142 | private: | 142 | private: |
143 | int m_num; | 143 | int m_num; |
144 | }; | 144 | }; |
@@ -193,17 +193,20 @@ public: | |||
193 | void checkMenu(); | 193 | void checkMenu(); |
194 | 194 | ||
195 | void hideExtraMenus(BScreen &screen); | 195 | void hideExtraMenus(BScreen &screen); |
196 | 196 | ||
197 | /// handle any system signal sent to the application | 197 | /// handle any system signal sent to the application |
198 | void handleSignal(int signum); | 198 | void handleSignal(int signum); |
199 | void update(FbTk::Subject *changed); | 199 | void update(FbTk::Subject *changed); |
200 | 200 | ||
201 | void attachSignals(FluxboxWindow &win); | 201 | void attachSignals(FluxboxWindow &win); |
202 | void attachSignals(WinClient &winclient); | 202 | void attachSignals(WinClient &winclient); |
203 | 203 | ||
204 | void timed_reconfigure(); | 204 | void timed_reconfigure(); |
205 | 205 | ||
206 | bool isStartup() const { return m_starting; } | 206 | bool isStartup() const { return m_starting; } |
207 | bool isRestarting() const { return m_restarting; } | ||
208 | |||
209 | const std::string &getRestartArgument() const { return m_restart_argument; } | ||
207 | 210 | ||
208 | /// get screen from number | 211 | /// get screen from number |
209 | BScreen *findScreen(int num); | 212 | BScreen *findScreen(int num); |
@@ -221,6 +224,7 @@ public: | |||
221 | // screen we are watching for modifier changes | 224 | // screen we are watching for modifier changes |
222 | BScreen *watchingScreen() { return m_watching_screen; } | 225 | BScreen *watchingScreen() { return m_watching_screen; } |
223 | const XEvent &lastEvent() const { return m_last_event; } | 226 | const XEvent &lastEvent() const { return m_last_event; } |
227 | |||
224 | private: | 228 | private: |
225 | 229 | ||
226 | typedef struct MenuTimestamp { | 230 | typedef struct MenuTimestamp { |
@@ -232,24 +236,24 @@ private: | |||
232 | 236 | ||
233 | std::string getRcFilename(); | 237 | std::string getRcFilename(); |
234 | void load_rc(); | 238 | void load_rc(); |
235 | |||
236 | void reload_rc(); | 239 | void reload_rc(); |
240 | |||
237 | void real_rereadMenu(); | 241 | void real_rereadMenu(); |
238 | void real_reconfigure(); | 242 | void real_reconfigure(); |
239 | 243 | ||
240 | void handleEvent(XEvent *xe); | 244 | void handleEvent(XEvent *xe); |
241 | 245 | ||
242 | void setupConfigFiles(); | 246 | void setupConfigFiles(); |
243 | void handleButtonEvent(XButtonEvent &be); | 247 | void handleButtonEvent(XButtonEvent &be); |
244 | void handleUnmapNotify(XUnmapEvent &ue); | 248 | void handleUnmapNotify(XUnmapEvent &ue); |
245 | void handleClientMessage(XClientMessageEvent &ce); | 249 | void handleClientMessage(XClientMessageEvent &ce); |
246 | void handleKeyEvent(XKeyEvent &ke); | 250 | void handleKeyEvent(XKeyEvent &ke); |
247 | void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg); | 251 | void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg); |
248 | 252 | ||
249 | std::auto_ptr<FbAtoms> m_fbatoms; | 253 | std::auto_ptr<FbAtoms> m_fbatoms; |
250 | 254 | ||
251 | FbTk::ResourceManager m_resourcemanager, &m_screen_rm; | 255 | FbTk::ResourceManager m_resourcemanager, &m_screen_rm; |
252 | 256 | ||
253 | //--- Resources | 257 | //--- Resources |
254 | 258 | ||
255 | FbTk::Resource<bool> m_rc_tabs, m_rc_ignoreborder; | 259 | FbTk::Resource<bool> m_rc_tabs, m_rc_ignoreborder; |
@@ -258,11 +262,11 @@ private: | |||
258 | m_rc_double_click_interval, m_rc_update_delay_time, | 262 | m_rc_double_click_interval, m_rc_update_delay_time, |
259 | m_rc_tabs_padding, | 263 | m_rc_tabs_padding, |
260 | m_rc_focused_tab_min_width; | 264 | m_rc_focused_tab_min_width; |
261 | FbTk::Resource<std::string> m_rc_stylefile, | 265 | FbTk::Resource<std::string> m_rc_stylefile, |
262 | m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, | 266 | m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, |
263 | m_rc_groupfile; | 267 | m_rc_groupfile; |
264 | 268 | ||
265 | 269 | ||
266 | FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; | 270 | FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; |
267 | FbTk::Resource<TabsAttachArea> m_rc_tabs_attach_area; | 271 | FbTk::Resource<TabsAttachArea> m_rc_tabs_attach_area; |
268 | FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; | 272 | FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; |
@@ -277,7 +281,7 @@ private: | |||
277 | // The group leader (which may not be mapped, so may not have a WinClient) | 281 | // The group leader (which may not be mapped, so may not have a WinClient) |
278 | // will have it's window being the group index | 282 | // will have it's window being the group index |
279 | std::multimap<Window, WinClient *> m_group_search; | 283 | std::multimap<Window, WinClient *> m_group_search; |
280 | 284 | ||
281 | std::list<MenuTimestamp *> m_menu_timestamps; | 285 | std::list<MenuTimestamp *> m_menu_timestamps; |
282 | typedef std::list<BScreen *> ScreenList; | 286 | typedef std::list<BScreen *> ScreenList; |
283 | ScreenList m_screen_list; | 287 | ScreenList m_screen_list; |
@@ -297,6 +301,9 @@ private: | |||
297 | std::string m_rc_file; ///< resource filename | 301 | std::string m_rc_file; ///< resource filename |
298 | char **m_argv; | 302 | char **m_argv; |
299 | int m_argc; | 303 | int m_argc; |
304 | |||
305 | std::string m_restart_argument; ///< what to restart | ||
306 | |||
300 | XEvent m_last_event; | 307 | XEvent m_last_event; |
301 | 308 | ||
302 | FbTk::Timer m_reconfig_timer; ///< when we execute reconfig command we must wait at least to next event round | 309 | FbTk::Timer m_reconfig_timer; ///< when we execute reconfig command we must wait at least to next event round |
@@ -315,6 +322,7 @@ private: | |||
315 | Toolbars m_toolbars; | 322 | Toolbars m_toolbars; |
316 | 323 | ||
317 | bool m_starting; | 324 | bool m_starting; |
325 | bool m_restarting; | ||
318 | bool m_shutdown; | 326 | bool m_shutdown; |
319 | int m_server_grabs; | 327 | int m_server_grabs; |
320 | int m_randr_event_type; ///< the type number of randr event | 328 | int m_randr_event_type; ///< the type number of randr event |