LOGIN / SIGN UP
19 Author: Andreas
Date: Fri May 08 19:59:46 +0200 2009
Subject: Revert the session code.
    Rationale:
    Claes ran successfully pekwm under gnome without the session management code.
    The session code didn't actually load/save the session and therefore it is
    removed for 0.1.11. Should it cause any regressions under gnome I'll re-add it.

src/WindowManager.cc
 
143 @@ -143,24 +143,7 @@
143 break;
144 }
145 }
146
147 #ifdef HAVE_SESSION
148 /**
149 * Handler setting ice connections
150 */
151 static void
152 iceWatch(IceConn ice_conn, IcePointer data,
153 Bool opening, IcePointer *watch_data)
154 {
155 if (opening) {
156 WindowManager::instance()->setIceConn(ice_conn);
157 WindowManager::instance()->setIceFd(IceConnectionNumber(ice_conn));
158 } else {
159 WindowManager::instance()->setIceConn(0);
160 WindowManager::instance()->setIceFd(0);
161 }
162 }
163 #endif // HAVE_SESSION
164
165 } // extern "C"
166
167
...  
207 @@ -224,10 +207,6 @@
207 #endif // HARBOUR
208 _cmd_dialog(0), _search_dialog(0),
209 _status_window(0), _workspace_indicator(0),
227 _max_fd(0), _dpy_fd(0),
228 #ifdef HAVE_SESSION
229 _ice_fd(0), _ice_conn(0),
230 #endif // HAVE_SESSION
214 _command_line(command_line),
215 _startup(false), _shutdown(false), _reload(false),
216 _allow_grouping(true), _hint_wo(0), _root_wo(0)
...  
368 @@ -389,8 +368,6 @@
368
369 // Setup screen, init atoms and claim the display.
370 _screen = new PScreen(dpy, _config->isHonourRandr());
392 _dpy_fd = ConnectionNumber(dpy);
393 _max_fd = _dpy_fd + 1;
373
374 Atoms::init();
375
...  
777 @@ -800,13 +777,8 @@
777 WindowManager::doEventLoop(void)
778 {
779 XEvent ev;
803 bool is_xevent, is_icevent;
781 Timer<ActionPerformed>::timed_event_list events;
782
806 #ifdef HAVE_SESSION
807 IceAddConnectionWatch(iceWatch, NULL);
808 #endif // HAVE_SESSION
809
787 while (! _shutdown && ! is_signal_int_term) {
788 // Handle timeouts
789 if (is_signal_alrm) {
...  
799 @@ -827,13 +799,8 @@
799 doReload();
800 }
801
830 // Wait for IO
831 waitIO(is_xevent, is_icevent);
832
805 // Get next event, drop event handling if none was given
834 if (is_xevent) {
835 XNextEvent(_screen->getDpy(), &ev);
836
809 if (_screen->getNextEvent(ev)) {
810 switch (ev.type) {
811 case MapRequest:
812 handleMapRequestEvent(&ev.xmaprequest);
...  
887 @@ -920,55 +887,6 @@
887 break;
888 }
889 }
923
924 #ifdef HAVE_SESSION
925 if (is_icevent) {
926 Bool dummy_b;
927 // Process messages, might not
928 IceProcessMessages(_ice_conn, NULL, &dummy_b);
929 }
930 #endif // HAVE_SESSION
931 }
932
933 #ifdef HAVE_SESSION
934 IceRemoveConnectionWatch(iceWatch, NULL);
935 #endif // HAVE_SESSION
936 }
937
938 /**
939 * Wait for data from connections.
940 */
941 void
942 WindowManager::waitIO(bool &is_xevent, bool &is_iceevent)
943 {
944 is_xevent = is_iceevent = false;
945
946 if (XPending(PScreen::instance()->getDpy()) > 0) {
947 is_xevent = true;
948 return;
949 }
950
951 // Make sure to flush X11 connection before starting to wait or
952 // else we might end up waiting here forever.
953 XFlush(_screen->getDpy());
954
955 int ret;
956 fd_set rfds;
957
958 FD_ZERO(&rfds);
959 FD_SET(_dpy_fd, &rfds);
960 #ifdef HAVE_SESSION
961 if (_ice_fd) {
962 FD_SET(_ice_fd, &rfds);
963 }
964 #endif // HAVE_SESSION
965
966 ret = select(_max_fd, &rfds, 0, 0, 0);
967 if (ret > 0) {
968 is_xevent = FD_ISSET(_dpy_fd, &rfds);
969 #ifdef HAVE_SESSION
970 is_iceevent = FD_ISSET(_ice_fd, &rfds);
971 #endif // HAVE_SESSION
939 }
940 }
941
...  

src/WindowManager.hh
 
27 @@ -27,14 +27,11 @@
27 #include <list>
28 #include <map>
29
30 extern "C" {
31 #ifdef HAVE_XRANDR
32 extern "C" {
33 #include <X11/extensions/Xrandr.h>
34 #endif // HAVE_XRANDR
35 #ifdef HAVE_SESSION
36 #include <X11/ICE/ICElib.h>
37 #endif // HAVE_SESSION
38 }
39 #endif // HAVE_XRANDR
40
41 class ActionHandler;
42 class AutoProperties;
...  
80 @@ -83,14 +80,6 @@
80 /**< Return shutdown flag, set to tru to shutdown window manager. */
81 bool *getShutdownFlag(void) { return &_shutdown; }
82
86 #ifdef HAVE_SESSION
87 void setIceConn(IceConn ice_conn) { _ice_conn = ice_conn; }
88 void setIceFd(int ice_fd) {
89 _ice_fd = ice_fd;
90 _max_fd = std::max(_dpy_fd, _ice_fd) + 1;
91 }
92 #endif // HAVE_SESSION
93
91 // get "base" classes
92 inline PScreen *getScreen(void) const { return _screen; }
93 inline Config *getConfig(void) const { return _config; }
...  
177 @@ -188,8 +177,6 @@
177 void scanWindows(void);
178 void execStartFile(void);
179
191 void waitIO(bool &is_xevent, bool &is_iceevent);
192
182 void doReload(void);
183 void doReloadConfig(void);
184 void doReloadTheme(void);
...  
267 @@ -280,13 +267,6 @@
267 static const unsigned int MENU_NAMES_RESERVED_COUNT;
268 #endif // MENUS
269
283 int _max_fd; /**< Max file descriptor to select on. */
284 int _dpy_fd; /**< Display file descriptor. */
285 #ifdef HAVE_SESSION
286 int _ice_fd; /**< ICE file descriptor.*/
287 IceConn _ice_conn; /**< Connection to ICE. */
288 #endif // HAVE_SESSION
289
277 std::string _command_line, _restart_command;
278 bool _startup; //!< Indicates startup status.
279 bool _shutdown; //!< Set to wheter we want to shutdown.
...