aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Slit.cc')
-rw-r--r--src/Slit.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index 48a916e..19cce1a 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -19,8 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// stupid macros needed to access some functions in version 2 of the GNU C 22//use GNU extensions
23// library
24#ifndef _GNU_SOURCE 23#ifndef _GNU_SOURCE
25#define _GNU_SOURCE 24#define _GNU_SOURCE
26#endif // _GNU_SOURCE 25#endif // _GNU_SOURCE
@@ -76,8 +75,8 @@ Slit::Slit(BScreen *scr) {
76 frame.window = 75 frame.window =
77 XCreateWindow(display, screen->getRootWindow(), frame.x, frame.y, 76 XCreateWindow(display, screen->getRootWindow(), frame.x, frame.y,
78 frame.width, frame.height, screen->getBorderWidth(), 77 frame.width, frame.height, screen->getBorderWidth(),
79 screen->getDepth(), InputOutput, screen->getVisual(), 78 screen->getDepth(), InputOutput, screen->getVisual(),
80 create_mask, &attrib); 79 create_mask, &attrib);
81 fluxbox->saveSlitSearch(frame.window, this); 80 fluxbox->saveSlitSearch(frame.window, this);
82 81
83 reconfigure(); 82 reconfigure();
@@ -103,7 +102,6 @@ Slit::~Slit() {
103 102
104void Slit::addClient(Window w) { 103void Slit::addClient(Window w) {
105 fluxbox->grab(); 104 fluxbox->grab();
106
107 if (fluxbox->validateWindow(w)) { 105 if (fluxbox->validateWindow(w)) {
108 SlitClient *client = new SlitClient; 106 SlitClient *client = new SlitClient;
109 client->client_window = w; 107 client->client_window = w;
@@ -128,16 +126,8 @@ void Slit::addClient(Window w) {
128 client->icon_window = None; 126 client->icon_window = None;
129 client->window = client->client_window; 127 client->window = client->client_window;
130 } 128 }
131 #ifndef KDE
132 XWindowAttributes attrib; 129 XWindowAttributes attrib;
133 if (XGetWindowAttributes(display, client->window, &attrib)) { 130 #ifdef KDE
134 client->width = attrib.width;
135 client->height = attrib.height;
136 } else {
137 client->width = client->height = 64;
138 }
139 #else //KDE stuff starts here
140 XWindowAttributes attrib;
141 //Check and see if new client is a KDE dock applet 131 //Check and see if new client is a KDE dock applet
142 //If so force reasonable size 132 //If so force reasonable size
143 bool iskdedockapp=false; 133 bool iskdedockapp=false;
@@ -169,14 +159,16 @@ void Slit::addClient(Window w) {
169 159
170 if (iskdedockapp) 160 if (iskdedockapp)
171 client->width = client->height = 24; 161 client->width = client->height = 24;
172 else { 162 else
163 #endif // KDE
164 {
173 if (XGetWindowAttributes(display, client->window, &attrib)) { 165 if (XGetWindowAttributes(display, client->window, &attrib)) {
174 client->width = attrib.width; 166 client->width = attrib.width;
175 client->height = attrib.height; 167 client->height = attrib.height;
176 } else 168 } else {
177 client->width = client->height = 64; 169 client->width = client->height = 64;
170 }
178 } 171 }
179 #endif // KDE
180 172
181 XSetWindowBorderWidth(display, client->window, 0); 173 XSetWindowBorderWidth(display, client->window, 0);
182 174