diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 29 | ||||
-rw-r--r-- | src/fluxbox.cc | 49 | ||||
-rw-r--r-- | src/fluxbox.hh | 13 | ||||
-rw-r--r-- | src/main.cc | 9 |
4 files changed, 63 insertions, 37 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 0d1923b..7992a19 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -132,7 +132,7 @@ extern "C" { | |||
132 | } | 132 | } |
133 | #endif // XINERAMA | 133 | #endif // XINERAMA |
134 | 134 | ||
135 | #ifdef HAVE_RANDR | 135 | #if defined(HAVE_RANDR) || defined(HAVE_RANDR1_2) |
136 | #include <X11/extensions/Xrandr.h> | 136 | #include <X11/extensions/Xrandr.h> |
137 | #endif // HAVE_RANDR | 137 | #endif // HAVE_RANDR |
138 | 138 | ||
@@ -380,19 +380,26 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
380 | XFree(ret_prop); | 380 | XFree(ret_prop); |
381 | } | 381 | } |
382 | 382 | ||
383 | #ifdef HAVE_RANDR | ||
384 | // setup RANDR for this screens root window | ||
385 | // we need to determine if we should use old randr select input function or not | ||
386 | #ifdef X_RRScreenChangeSelectInput | ||
387 | // use old set randr event | ||
388 | XRRScreenChangeSelectInput(disp, rootWindow().window(), True); | ||
389 | #else | ||
390 | XRRSelectInput(disp, rootWindow().window(), | ||
391 | RRScreenChangeNotifyMask); | ||
392 | #endif // X_RRScreenChangeSelectInput | ||
393 | 383 | ||
384 | // setup RANDR for this screens root window | ||
385 | #if defined(HAVE_RANDR1_2) | ||
386 | int randr_mask = RRScreenChangeNotifyMask; | ||
387 | #ifdef RRCrtcChangeNotifyMask | ||
388 | randr_mask |= RRCrtcChangeNotifyMask; | ||
389 | #endif | ||
390 | #ifdef RROutputChangeNotifyMask | ||
391 | randr_mask |= RROutputChangeNotifyMask; | ||
392 | #endif | ||
393 | #ifdef RROutputPropertyNotifyMask | ||
394 | randr_mask |= RROutputPropertyNotifyMask; | ||
395 | #endif | ||
396 | XRRSelectInput(disp, rootWindow().window(), randr_mask); | ||
397 | |||
398 | #elif defined(HAVE_RANDR) | ||
399 | XRRScreenChangeSelectInput(disp, rootWindow().window(), True); | ||
394 | #endif // HAVE_RANDR | 400 | #endif // HAVE_RANDR |
395 | 401 | ||
402 | |||
396 | _FB_USES_NLS; | 403 | _FB_USES_NLS; |
397 | 404 | ||
398 | #ifdef DEBUG | 405 | #ifdef DEBUG |
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index c144630..7dd0c4c 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -84,7 +84,7 @@ | |||
84 | #ifdef SHAPE | 84 | #ifdef SHAPE |
85 | #include <X11/extensions/shape.h> | 85 | #include <X11/extensions/shape.h> |
86 | #endif // SHAPE | 86 | #endif // SHAPE |
87 | #ifdef HAVE_RANDR | 87 | #if defined(HAVE_RANDR) || defined(HAVE_RANDR1_2) |
88 | #include <X11/extensions/Xrandr.h> | 88 | #include <X11/extensions/Xrandr.h> |
89 | #endif // HAVE_RANDR | 89 | #endif // HAVE_RANDR |
90 | 90 | ||
@@ -218,10 +218,17 @@ struct CallMemFunWithRefArg : std::unary_function<Type, ResultType> { | |||
218 | }; | 218 | }; |
219 | 219 | ||
220 | 220 | ||
221 | int s_randr_event_type = 0; ///< the type number of randr event | ||
222 | int s_shape_eventbase = 0; ///< event base for shape events | ||
223 | bool s_have_shape = false ; ///< if shape is supported by server | ||
224 | |||
225 | Atom s_kwm1_dockwindow; | ||
226 | Atom s_kwm2_dockwindow; | ||
227 | |||
228 | Fluxbox* s_singleton = 0; | ||
229 | |||
221 | } // end anonymous | 230 | } // end anonymous |
222 | 231 | ||
223 | //static singleton var | ||
224 | Fluxbox *Fluxbox::s_singleton=0; | ||
225 | 232 | ||
226 | Fluxbox::Fluxbox(int argc, char **argv, | 233 | Fluxbox::Fluxbox(int argc, char **argv, |
227 | const std::string& dpy_name, | 234 | const std::string& dpy_name, |
@@ -261,8 +268,7 @@ Fluxbox::Fluxbox(int argc, char **argv, | |||
261 | m_starting(true), | 268 | m_starting(true), |
262 | m_restarting(false), | 269 | m_restarting(false), |
263 | m_shutdown(false), | 270 | m_shutdown(false), |
264 | m_server_grabs(0), | 271 | m_server_grabs(0) { |
265 | m_randr_event_type(0) { | ||
266 | 272 | ||
267 | _FB_USES_NLS; | 273 | _FB_USES_NLS; |
268 | if (s_singleton != 0) | 274 | if (s_singleton != 0) |
@@ -277,10 +283,10 @@ Fluxbox::Fluxbox(int argc, char **argv, | |||
277 | Display *disp = FbTk::App::instance()->display(); | 283 | Display *disp = FbTk::App::instance()->display(); |
278 | // For KDE dock applets | 284 | // For KDE dock applets |
279 | // KDE v1.x | 285 | // KDE v1.x |
280 | m_kwm1_dockwindow = XInternAtom(disp, | 286 | s_kwm1_dockwindow = XInternAtom(disp, |
281 | "KWM_DOCKWINDOW", False); | 287 | "KWM_DOCKWINDOW", False); |
282 | // KDE v2.x | 288 | // KDE v2.x |
283 | m_kwm2_dockwindow = XInternAtom(disp, | 289 | s_kwm2_dockwindow = XInternAtom(disp, |
284 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); | 290 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); |
285 | // setup X error handler | 291 | // setup X error handler |
286 | XSetErrorHandler((XErrorHandler) handleXErrors); | 292 | XSetErrorHandler((XErrorHandler) handleXErrors); |
@@ -314,21 +320,18 @@ Fluxbox::Fluxbox(int argc, char **argv, | |||
314 | XSynchronize(disp, True); | 320 | XSynchronize(disp, True); |
315 | 321 | ||
316 | s_singleton = this; | 322 | s_singleton = this; |
317 | m_have_shape = false; | 323 | |
318 | m_shape_eventbase = 0; | ||
319 | #ifdef SHAPE | 324 | #ifdef SHAPE |
320 | int shape_err; | 325 | int shape_err; |
321 | m_have_shape = XShapeQueryExtension(disp, &m_shape_eventbase, &shape_err); | 326 | s_have_shape = XShapeQueryExtension(disp, &s_shape_eventbase, &shape_err); |
322 | #endif // SHAPE | 327 | #endif // SHAPE |
323 | 328 | ||
324 | #ifdef HAVE_RANDR | 329 | #if defined(HAVE_RANDR) || defined(HAVE_RANDR1_2) |
325 | // get randr event type | ||
326 | int randr_error_base; | 330 | int randr_error_base; |
327 | XRRQueryExtension(disp, &m_randr_event_type, &randr_error_base); | 331 | XRRQueryExtension(disp, &s_randr_event_type, &randr_error_base); |
328 | #endif // HAVE_RANDR | 332 | #endif // HAVE_RANDR |
329 | 333 | ||
330 | load_rc(); | 334 | load_rc(); |
331 | |||
332 | grab(); | 335 | grab(); |
333 | 336 | ||
334 | if (! XSupportsLocale()) | 337 | if (! XSupportsLocale()) |
@@ -796,8 +799,8 @@ void Fluxbox::handleEvent(XEvent * const e) { | |||
796 | break; | 799 | break; |
797 | default: { | 800 | default: { |
798 | 801 | ||
799 | #ifdef HAVE_RANDR | 802 | #if defined(HAVE_RANDR) || defined(HAVE_RANDR1_2) |
800 | if (e->type == m_randr_event_type) { | 803 | if (e->type == s_randr_event_type) { |
801 | #ifdef HAVE_RANDR1_2 | 804 | #ifdef HAVE_RANDR1_2 |
802 | XRRUpdateConfiguration(e); | 805 | XRRUpdateConfiguration(e); |
803 | #endif | 806 | #endif |
@@ -1400,3 +1403,17 @@ void Fluxbox::workspaceAreaChanged(BScreen &screen) { | |||
1400 | CallMemFunWithRefArg<AtomHandler, BScreen&, void>(&AtomHandler::updateWorkarea, screen)); | 1403 | CallMemFunWithRefArg<AtomHandler, BScreen&, void>(&AtomHandler::updateWorkarea, screen)); |
1401 | } | 1404 | } |
1402 | 1405 | ||
1406 | bool Fluxbox::haveShape() const { | ||
1407 | return s_have_shape; | ||
1408 | } | ||
1409 | |||
1410 | int Fluxbox::shapeEventbase() const { | ||
1411 | return s_shape_eventbase; | ||
1412 | } | ||
1413 | |||
1414 | Fluxbox* Fluxbox::instance() { | ||
1415 | return s_singleton; | ||
1416 | } | ||
1417 | |||
1418 | |||
1419 | |||
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index d1e8e93..35c1649 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh | |||
@@ -83,7 +83,7 @@ public: | |||
83 | bool xsync = false); | 83 | bool xsync = false); |
84 | virtual ~Fluxbox(); | 84 | virtual ~Fluxbox(); |
85 | 85 | ||
86 | static Fluxbox *instance() { return s_singleton; } | 86 | static Fluxbox *instance(); |
87 | 87 | ||
88 | /// main event loop | 88 | /// main event loop |
89 | void eventLoop(); | 89 | void eventLoop(); |
@@ -177,8 +177,8 @@ public: | |||
177 | typedef std::list<BScreen *> ScreenList; | 177 | typedef std::list<BScreen *> ScreenList; |
178 | const ScreenList screenList() const { return m_screen_list; } | 178 | const ScreenList screenList() const { return m_screen_list; } |
179 | 179 | ||
180 | bool haveShape() const { return m_have_shape; } | 180 | bool haveShape() const; |
181 | int shapeEventbase() const { return m_shape_eventbase; } | 181 | int shapeEventbase() const; |
182 | std::string getDefaultDataFilename(const char *name) const; | 182 | std::string getDefaultDataFilename(const char *name) const; |
183 | // screen mouse was in at last key event | 183 | // screen mouse was in at last key event |
184 | BScreen *mouseScreen() { return m_mousescreen; } | 184 | BScreen *mouseScreen() { return m_mousescreen; } |
@@ -285,9 +285,6 @@ private: | |||
285 | 285 | ||
286 | std::auto_ptr<Keys> m_key; | 286 | std::auto_ptr<Keys> m_key; |
287 | 287 | ||
288 | //default arguments for titlebar left and right | ||
289 | static Fluxbox *s_singleton; | ||
290 | |||
291 | typedef std::set<AtomHandler *> AtomHandlerContainer; | 288 | typedef std::set<AtomHandler *> AtomHandlerContainer; |
292 | typedef AtomHandlerContainer::iterator AtomHandlerContainerIt; | 289 | typedef AtomHandlerContainer::iterator AtomHandlerContainerIt; |
293 | 290 | ||
@@ -297,10 +294,6 @@ private: | |||
297 | bool m_restarting; | 294 | bool m_restarting; |
298 | bool m_shutdown; | 295 | bool m_shutdown; |
299 | int m_server_grabs; | 296 | int m_server_grabs; |
300 | int m_randr_event_type; ///< the type number of randr event | ||
301 | int m_shape_eventbase; ///< event base for shape events | ||
302 | bool m_have_shape; ///< if shape is supported by server | ||
303 | Atom m_kwm1_dockwindow, m_kwm2_dockwindow; | ||
304 | 297 | ||
305 | AttentionNoticeHandler m_attention_handler; | 298 | AttentionNoticeHandler m_attention_handler; |
306 | }; | 299 | }; |
diff --git a/src/main.cc b/src/main.cc index c93aabf..74a3373 100644 --- a/src/main.cc +++ b/src/main.cc | |||
@@ -192,6 +192,15 @@ static void showInfo(ostream &ostr) { | |||
192 | #endif // USE_TOOLBAR | 192 | #endif // USE_TOOLBAR |
193 | "TOOLBAR" << endl << | 193 | "TOOLBAR" << endl << |
194 | 194 | ||
195 | #ifndef HAVE_RANDR | ||
196 | NOT << | ||
197 | #endif | ||
198 | "RANDR" << | ||
199 | #ifdef HAVE_RANDR1_2 | ||
200 | "1.2" << | ||
201 | #endif | ||
202 | endl << | ||
203 | |||
195 | #ifndef USE_XFT | 204 | #ifndef USE_XFT |
196 | NOT << | 205 | NOT << |
197 | #endif // USE_XFT | 206 | #endif // USE_XFT |