diff options
-rw-r--r-- | src/Netizen.cc | 29 | ||||
-rw-r--r-- | src/Netizen.hh | 8 |
2 files changed, 18 insertions, 19 deletions
diff --git a/src/Netizen.cc b/src/Netizen.cc index c9d26ef..8d85d1e 100644 --- a/src/Netizen.cc +++ b/src/Netizen.cc | |||
@@ -27,40 +27,39 @@ | |||
27 | #include "Screen.hh" | 27 | #include "Screen.hh" |
28 | #include "FbAtoms.hh" | 28 | #include "FbAtoms.hh" |
29 | 29 | ||
30 | Netizen::Netizen(const BScreen * const scr, Window win): | 30 | Netizen::Netizen(const BScreen &scr, Window win): |
31 | m_screen(scr), | 31 | m_screen(scr), |
32 | m_display(FbTk::App::instance()->display()), | 32 | m_display(FbTk::App::instance()->display()), |
33 | window(win) { | 33 | m_window(win) { |
34 | window = win; | ||
35 | 34 | ||
36 | event.type = ClientMessage; | 35 | event.type = ClientMessage; |
37 | event.xclient.message_type = FbAtoms::instance()->getFluxboxStructureMessagesAtom(); | 36 | event.xclient.message_type = FbAtoms::instance()->getFluxboxStructureMessagesAtom(); |
38 | event.xclient.display = m_display; | 37 | event.xclient.display = m_display; |
39 | event.xclient.window = window; | 38 | event.xclient.window = window(); |
40 | event.xclient.format = 32; | 39 | event.xclient.format = 32; |
41 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyStartupAtom(); | 40 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyStartupAtom(); |
42 | event.xclient.data.l[1] = event.xclient.data.l[2] = | 41 | event.xclient.data.l[1] = event.xclient.data.l[2] = |
43 | event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; | 42 | event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; |
44 | 43 | ||
45 | XSendEvent(m_display, window, False, NoEventMask, &event); | 44 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
46 | } | 45 | } |
47 | 46 | ||
48 | 47 | ||
49 | void Netizen::sendWorkspaceCount() { | 48 | void Netizen::sendWorkspaceCount() { |
50 | 49 | ||
51 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom(); | 50 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom(); |
52 | event.xclient.data.l[1] = m_screen->getCount(); | 51 | event.xclient.data.l[1] = m_screen.getCount(); |
53 | 52 | ||
54 | XSendEvent(m_display, window, False, NoEventMask, &event); | 53 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
55 | } | 54 | } |
56 | 55 | ||
57 | 56 | ||
58 | void Netizen::sendCurrentWorkspace() { | 57 | void Netizen::sendCurrentWorkspace() { |
59 | 58 | ||
60 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom(); | 59 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom(); |
61 | event.xclient.data.l[1] = m_screen->getCurrentWorkspaceID(); | 60 | event.xclient.data.l[1] = m_screen.getCurrentWorkspaceID(); |
62 | 61 | ||
63 | XSendEvent(m_display, window, False, NoEventMask, &event); | 62 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
64 | } | 63 | } |
65 | 64 | ||
66 | 65 | ||
@@ -68,7 +67,7 @@ void Netizen::sendWindowFocus(Window w) { | |||
68 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowFocusAtom(); | 67 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowFocusAtom(); |
69 | event.xclient.data.l[1] = w; | 68 | event.xclient.data.l[1] = w; |
70 | 69 | ||
71 | XSendEvent(m_display, window, False, NoEventMask, &event); | 70 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
72 | } | 71 | } |
73 | 72 | ||
74 | 73 | ||
@@ -77,7 +76,7 @@ void Netizen::sendWindowAdd(Window w, unsigned long wkspc) { | |||
77 | event.xclient.data.l[1] = w; | 76 | event.xclient.data.l[1] = w; |
78 | event.xclient.data.l[2] = wkspc; | 77 | event.xclient.data.l[2] = wkspc; |
79 | 78 | ||
80 | XSendEvent(m_display, window, False, NoEventMask, &event); | 79 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
81 | 80 | ||
82 | event.xclient.data.l[2] = 0l; | 81 | event.xclient.data.l[2] = 0l; |
83 | } | 82 | } |
@@ -87,7 +86,7 @@ void Netizen::sendWindowDel(Window w) { | |||
87 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowDelAtom(); | 86 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowDelAtom(); |
88 | event.xclient.data.l[1] = w; | 87 | event.xclient.data.l[1] = w; |
89 | 88 | ||
90 | XSendEvent(m_display, window, False, NoEventMask, &event); | 89 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
91 | } | 90 | } |
92 | 91 | ||
93 | 92 | ||
@@ -95,7 +94,7 @@ void Netizen::sendWindowRaise(Window w) { | |||
95 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowRaiseAtom(); | 94 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowRaiseAtom(); |
96 | event.xclient.data.l[1] = w; | 95 | event.xclient.data.l[1] = w; |
97 | 96 | ||
98 | XSendEvent(m_display, window, False, NoEventMask, &event); | 97 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
99 | } | 98 | } |
100 | 99 | ||
101 | 100 | ||
@@ -103,9 +102,9 @@ void Netizen::sendWindowLower(Window w) { | |||
103 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowLowerAtom(); | 102 | event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowLowerAtom(); |
104 | event.xclient.data.l[1] = w; | 103 | event.xclient.data.l[1] = w; |
105 | 104 | ||
106 | XSendEvent(m_display, window, False, NoEventMask, &event); | 105 | XSendEvent(m_display, window(), False, NoEventMask, &event); |
107 | } | 106 | } |
108 | 107 | ||
109 | void Netizen::sendConfigNotify(XEvent *e) { | 108 | void Netizen::sendConfigNotify(XEvent *e) { |
110 | XSendEvent(m_display, window, False, StructureNotifyMask, e); | 109 | XSendEvent(m_display, window(), False, StructureNotifyMask, e); |
111 | } | 110 | } |
diff --git a/src/Netizen.hh b/src/Netizen.hh index d872ebe..c03f97e 100644 --- a/src/Netizen.hh +++ b/src/Netizen.hh | |||
@@ -30,9 +30,9 @@ class BScreen; | |||
30 | 30 | ||
31 | class Netizen { | 31 | class Netizen { |
32 | public: | 32 | public: |
33 | Netizen(const BScreen * const scr, Window w); | 33 | Netizen(const BScreen &scr, Window w); |
34 | 34 | ||
35 | inline Window getWindowID() const { return window; } | 35 | inline Window window() const { return m_window; } |
36 | 36 | ||
37 | void sendWorkspaceCount(); | 37 | void sendWorkspaceCount(); |
38 | void sendCurrentWorkspace(); | 38 | void sendCurrentWorkspace(); |
@@ -45,9 +45,9 @@ public: | |||
45 | 45 | ||
46 | void sendConfigNotify(XEvent *xe); | 46 | void sendConfigNotify(XEvent *xe); |
47 | private: | 47 | private: |
48 | const BScreen * const m_screen; | 48 | const BScreen &m_screen; |
49 | Display *m_display; ///< display connection | 49 | Display *m_display; ///< display connection |
50 | Window window; | 50 | Window m_window; |
51 | XEvent event; | 51 | XEvent event; |
52 | 52 | ||
53 | }; | 53 | }; |