~ubuntu-branches/ubuntu/trusty/fluxbox/trusty-proposed

« back to all changes in this revision

Viewing changes to src/FbTk/FbWindow.cc

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2008-07-01 10:38:14 UTC
  • mfrom: (2.1.12 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080701103814-khx2b6il152x9p93
Tags: 1.0.0+deb1-8
* x-dev has been removed from build-depends (out-of-date package).
* Standards-Version bumped to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// FbWindow.cc for FbTk - fluxbox toolkit
2
 
// Copyright (c) 2002 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
3
 
//
4
 
// Permission is hereby granted, free of charge, to any person obtaining a
5
 
// copy of this software and associated documentation files (the "Software"),
6
 
// to deal in the Software without restriction, including without limitation
7
 
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
 
// and/or sell copies of the Software, and to permit persons to whom the
9
 
// Software is furnished to do so, subject to the following conditions:
10
 
//
11
 
// The above copyright notice and this permission notice shall be included in
12
 
// all copies or substantial portions of the Software.
13
 
//
14
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
 
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
 
// DEALINGS IN THE SOFTWARE.
21
 
 
22
 
// $Id: FbWindow.cc 3998 2005-05-07 12:59:43Z simonb $
23
 
 
24
 
#include "FbWindow.hh"
25
 
#include "FbPixmap.hh"
26
 
 
27
 
#include "EventManager.hh"
28
 
#include "Color.hh"
29
 
#include "App.hh"
30
 
#include "Transparent.hh"
31
 
 
32
 
#ifdef HAVE_CONFIG_H
33
 
#include "config.h"
34
 
#endif // HAVE_CONFIG_H
35
 
 
36
 
#include <X11/Xutil.h>
37
 
#include <X11/Xatom.h>
38
 
 
39
 
#ifdef HAVE_CASSERT
40
 
  #include <cassert>
41
 
#else
42
 
  #include <assert.h>
43
 
#endif
44
 
 
45
 
namespace FbTk {
46
 
 
47
 
FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0),
48
 
                     m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true),
49
 
                     m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0) {
50
 
 
51
 
}
52
 
 
53
 
FbWindow::FbWindow(const FbWindow& the_copy):FbDrawable(),
54
 
                                             m_parent(the_copy.parent()),
55
 
                                             m_screen_num(the_copy.screenNumber()), m_window(the_copy.window()),
56
 
                                             m_x(the_copy.x()), m_y(the_copy.y()),
57
 
                                             m_width(the_copy.width()), m_height(the_copy.height()),
58
 
                                             m_border_width(the_copy.borderWidth()),
59
 
                                             m_depth(the_copy.depth()), m_destroy(true),
60
 
                                             m_lastbg_color_set(false), m_lastbg_color(0), 
61
 
                                             m_lastbg_pm(0), m_renderer(the_copy.m_renderer) {
62
 
    the_copy.m_window = 0;
63
 
}
64
 
 
65
 
FbWindow::FbWindow(int screen_num,
66
 
                   int x, int y,
67
 
                   unsigned int width, unsigned int height,
68
 
                   long eventmask,
69
 
                   bool override_redirect,
70
 
                   bool save_unders,
71
 
                   int depth,
72
 
                   int class_type):
73
 
    FbDrawable(),
74
 
    m_parent(0),
75
 
    m_screen_num(screen_num),
76
 
    m_destroy(true),
77
 
    m_lastbg_color_set(false),
78
 
    m_lastbg_color(0),
79
 
    m_lastbg_pm(0), m_renderer(0) {
80
 
 
81
 
    create(RootWindow(display(), screen_num),
82
 
           x, y, width, height, eventmask,
83
 
           override_redirect, save_unders, depth, class_type);
84
 
};
85
 
 
86
 
FbWindow::FbWindow(const FbWindow &parent,
87
 
                   int x, int y, unsigned int width, unsigned int height,
88
 
                   long eventmask,
89
 
                   bool override_redirect,
90
 
                   bool save_unders,
91
 
                   int depth, int class_type):
92
 
    m_parent(&parent),
93
 
    m_screen_num(parent.screenNumber()),
94
 
    m_destroy(true),
95
 
    m_lastbg_color_set(false), m_lastbg_color(0),
96
 
    m_lastbg_pm(0), m_renderer(0) {
97
 
 
98
 
    create(parent.window(), x, y, width, height, eventmask,
99
 
           override_redirect, save_unders, depth, class_type);
100
 
 
101
 
 
102
 
};
103
 
 
104
 
FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0),
105
 
                                  m_screen_num(0),
106
 
                                  m_window(0),
107
 
                                  m_x(0), m_y(0),
108
 
                                  m_width(1), m_height(1),
109
 
                                  m_border_width(0),
110
 
                                  m_depth(0),
111
 
                                  m_destroy(false),  // don't destroy this window
112
 
                                  m_lastbg_color_set(false), m_lastbg_color(0),
113
 
                                  m_lastbg_pm(0), m_renderer(0) {
114
 
 
115
 
    setNew(client);
116
 
}
117
 
 
118
 
FbWindow::~FbWindow() {
119
 
 
120
 
    // Need to free xrender pics before destroying window
121
 
    if (m_transparent.get() != 0)
122
 
        m_transparent.reset(0);
123
 
 
124
 
    if (m_window != 0) {
125
 
        // so we don't get any dangling eventhandler for this window
126
 
        FbTk::EventManager::instance()->remove(m_window);
127
 
        if (m_destroy)
128
 
            XDestroyWindow(display(), m_window);
129
 
    }
130
 
}
131
 
 
132
 
void FbWindow::setBackgroundColor(const FbTk::Color &bg_color) {
133
 
    if (bg_color.isAllocated()) {
134
 
        m_lastbg_color = bg_color.pixel();
135
 
        m_lastbg_color_set = true;
136
 
        m_lastbg_pm = None;
137
 
    } else {
138
 
        m_lastbg_color_set = false;
139
 
    }
140
 
 
141
 
    updateBackground(false);
142
 
}
143
 
 
144
 
void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) {
145
 
    m_lastbg_pm = bg_pixmap;
146
 
    if (bg_pixmap != None)
147
 
        m_lastbg_color_set = false;
148
 
 
149
 
    updateBackground(false);
150
 
}
151
 
 
152
 
void FbWindow::updateBackground(bool only_if_alpha) {
153
 
    Pixmap newbg = m_lastbg_pm;
154
 
    unsigned char alpha = 255;
155
 
    bool free_newbg = false;
156
 
 
157
 
    if (m_lastbg_pm == None && !m_lastbg_color_set)
158
 
        return;
159
 
 
160
 
    if (m_transparent.get() != 0)
161
 
        alpha = m_transparent->alpha();
162
 
 
163
 
    if (only_if_alpha && alpha == 255) 
164
 
        return;
165
 
 
166
 
    // still use bg buffer pixmap if not transparent
167
 
    // cause it does nice caching things, assuming we have a renderer
168
 
    if (m_lastbg_pm != ParentRelative && (m_renderer || alpha != 255)) {
169
 
        // update source and destination if needed
170
 
        Pixmap root = FbPixmap::getRootPixmap(screenNumber());
171
 
        if (alpha != 255 && m_transparent->source() != root)
172
 
            m_transparent->setSource(root, screenNumber());
173
 
 
174
 
        FbPixmap newpm = FbPixmap(*this, width(), height(), depth());
175
 
        free_newbg = true; // newpm gets released to newbg at end of block
176
 
        GC gc = XCreateGC(display(), window(), 0, 0);
177
 
 
178
 
        if (m_lastbg_pm == None && m_lastbg_color_set) {
179
 
            XSetForeground(display(), gc, m_lastbg_color);
180
 
            newpm.fillRectangle(gc, 0, 0, width(), height());
181
 
        } else {
182
 
            // copy from window if no color and no bg...
183
 
            newpm.copyArea((m_lastbg_pm == None)?drawable():m_lastbg_pm, gc, 0, 0, 0, 0, width(), height());
184
 
        }
185
 
        XFreeGC(display(), gc);
186
 
 
187
 
        if (alpha != 255)
188
 
            m_transparent->setDest(newpm.drawable(), screenNumber());
189
 
 
190
 
        // get root position
191
 
 
192
 
        const FbWindow *root_parent = parent();
193
 
        // our position in parent ("root")
194
 
        int root_x = x() + borderWidth(), root_y = y() + borderWidth();
195
 
        if (root_parent != 0) {
196
 
            root_x += root_parent->x() + root_parent->borderWidth();
197
 
            root_y += root_parent->y() + root_parent->borderWidth();
198
 
            while (root_parent->parent() != 0) {
199
 
                root_parent = root_parent->parent();
200
 
                root_x += root_parent->x() + root_parent->borderWidth();
201
 
                root_y += root_parent->y() + root_parent->borderWidth();
202
 
            }
203
 
        }
204
 
 
205
 
        // render background image from root pos to our window
206
 
        if (alpha != 255)
207
 
            m_transparent->render(root_x, root_y,
208
 
                                  0, 0,
209
 
                                  width(), height());
210
 
 
211
 
        // render any foreground items
212
 
        if (m_renderer)
213
 
            m_renderer->renderForeground(*this, newpm);
214
 
 
215
 
        if (alpha != 255)
216
 
            m_transparent->freeDest(); // it's only temporary, don't leave it hanging around
217
 
        newbg = newpm.release();
218
 
    }
219
 
 
220
 
    if (newbg != None)
221
 
        XSetWindowBackgroundPixmap(display(), m_window, newbg);
222
 
    else if (m_lastbg_color_set)
223
 
        XSetWindowBackground(display(), m_window, m_lastbg_color);
224
 
 
225
 
    if (free_newbg)
226
 
        XFreePixmap(display(), newbg);
227
 
}
228
 
 
229
 
void FbWindow::setBorderColor(const FbTk::Color &border_color) {
230
 
    XSetWindowBorder(display(), m_window, border_color.pixel());
231
 
}
232
 
 
233
 
void FbWindow::setBorderWidth(unsigned int size) {
234
 
    XSetWindowBorderWidth(display(), m_window, size);
235
 
    m_border_width = size;
236
 
}
237
 
 
238
 
void FbWindow::setName(const char *name) {
239
 
    XStoreName(display(), m_window, name);
240
 
}
241
 
 
242
 
void FbWindow::setEventMask(long mask) {
243
 
    XSelectInput(display(), m_window, mask);
244
 
}
245
 
 
246
 
void FbWindow::clear() {
247
 
    XClearWindow(display(), m_window);
248
 
}
249
 
 
250
 
void FbWindow::clearArea(int x, int y,
251
 
                         unsigned int width, unsigned int height,
252
 
                         bool exposures) {
253
 
    // TODO: probably could call renderForeground here (with x,y,w,h)
254
 
    XClearArea(display(), window(), x, y, width, height, exposures);
255
 
}
256
 
 
257
 
// If override_is_offset, then dest_override is a pixmap located at the_x, the_y
258
 
// with size the_width x the_height  in the target window.
259
 
 
260
 
void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, unsigned int the_height, Pixmap dest_override, bool override_is_offset) {
261
 
#ifdef HAVE_XRENDER
262
 
    if (!m_transparent.get())
263
 
        return;
264
 
 
265
 
    if (width() == 0 || height() == 0)
266
 
        return;
267
 
 
268
 
    if (!dest_override && (the_width == 0 && the_height == 0 || the_width == width() && the_height == height()) &&
269
 
        the_x <= 0 && the_y <= 0) {
270
 
        // do the whole thing
271
 
        updateBackground(true);
272
 
        return;
273
 
    }
274
 
 
275
 
    if (!dest_override)
276
 
        dest_override = window();
277
 
 
278
 
    if (the_width == 0 || the_height == 0) {
279
 
        the_width = width();
280
 
        the_height = height();
281
 
    }
282
 
 
283
 
    if (the_x < 0 || the_y < 0) {
284
 
        the_x = 0;
285
 
        the_y = 0;
286
 
    }
287
 
 
288
 
    // update source and destination if needed
289
 
    Pixmap root = FbPixmap::getRootPixmap(screenNumber());
290
 
    if (m_transparent->source() != root)
291
 
        m_transparent->setSource(root, screenNumber());
292
 
 
293
 
    if (m_transparent->dest() != dest_override)
294
 
        m_transparent->setDest(dest_override, screenNumber());
295
 
 
296
 
    // get root position
297
 
 
298
 
    const FbWindow *root_parent = parent();
299
 
    // our position in parent ("root")
300
 
    int root_x = x() + borderWidth(), root_y = y() + borderWidth();
301
 
    if (root_parent != 0) {
302
 
        root_x += root_parent->x() + root_parent->borderWidth();
303
 
        root_y += root_parent->y() + root_parent->borderWidth();
304
 
        while (root_parent->parent() != 0) {
305
 
            root_parent = root_parent->parent();
306
 
            root_x += root_parent->x() + root_parent->borderWidth();
307
 
            root_y += root_parent->y() + root_parent->borderWidth();
308
 
        }
309
 
 
310
 
    } // else toplevel window so we already have x, y set
311
 
 
312
 
    // render background image from root pos to our window
313
 
    m_transparent->render(root_x + the_x, root_y + the_y,
314
 
                          override_is_offset?0:the_x, override_is_offset?0:the_y,
315
 
                          the_width, the_height);
316
 
#endif // HAVE_XRENDER
317
 
}
318
 
 
319
 
void FbWindow::setAlpha(unsigned char alpha) {
320
 
#ifdef HAVE_XRENDER
321
 
    if (FbTk::Transparent::haveComposite()) {
322
 
        if (m_transparent.get() != 0)
323
 
            m_transparent.reset(0);
324
 
 
325
 
        // don't setOpaque, let controlling objects do that
326
 
        // since it's only needed on toplevel windows
327
 
    } else {
328
 
        if (!FbTk::Transparent::haveRender()) 
329
 
            alpha = 255;
330
 
 
331
 
        if (m_transparent.get() == 0 && alpha < 255) {
332
 
            m_transparent.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()), window(), alpha, screenNumber()));
333
 
        } else if (alpha < 255 && alpha != m_transparent->alpha())
334
 
            m_transparent->setAlpha(alpha);
335
 
        else if (alpha == 255)
336
 
            m_transparent.reset(0); // destroy transparent object
337
 
    }
338
 
#endif // HAVE_XRENDER
339
 
}
340
 
 
341
 
unsigned char FbWindow::alpha() const {
342
 
#ifdef HAVE_XRENDER
343
 
    if (m_transparent.get())
344
 
        return m_transparent->alpha();
345
 
#endif // HAVE_XRENDER
346
 
    return 255;
347
 
}
348
 
 
349
 
FbWindow &FbWindow::operator = (const FbWindow &win) {
350
 
    m_parent = win.parent();
351
 
    m_screen_num = win.screenNumber();
352
 
    m_window = win.window();
353
 
    m_x = win.x();
354
 
    m_y = win.y();
355
 
    m_width = win.width();
356
 
    m_height = win.height();
357
 
    m_border_width = win.borderWidth();
358
 
    m_depth = win.depth();
359
 
    // take over this window
360
 
    win.m_window = 0;
361
 
    return *this;
362
 
}
363
 
 
364
 
FbWindow &FbWindow::operator = (Window win) {
365
 
    setNew(win);
366
 
    return *this;
367
 
}
368
 
 
369
 
void FbWindow::setNew(Window win) {
370
 
 
371
 
    if (m_window != 0 && m_destroy)
372
 
        XDestroyWindow(display(), m_window);
373
 
 
374
 
    m_window = win;
375
 
 
376
 
    if (m_window != 0) {
377
 
        updateGeometry();
378
 
        XWindowAttributes attr;
379
 
        attr.screen = 0;
380
 
        //get screen number
381
 
        if (XGetWindowAttributes(display(),
382
 
                                 m_window,
383
 
                                 &attr) != 0 && attr.screen != 0) {
384
 
            m_screen_num = XScreenNumberOfScreen(attr.screen);
385
 
            if (attr.width <= 0)
386
 
                m_width = 1;
387
 
            else
388
 
                m_width = attr.width;
389
 
 
390
 
            if (attr.height <= 0)
391
 
                m_height = 1;
392
 
            else
393
 
                m_height = attr.height;
394
 
 
395
 
            m_x = attr.x;
396
 
            m_y = attr.y;
397
 
            m_depth = attr.depth;
398
 
            m_border_width = attr.border_width;
399
 
        }
400
 
 
401
 
    }
402
 
}
403
 
 
404
 
void FbWindow::show() {
405
 
    XMapWindow(display(), m_window);
406
 
}
407
 
 
408
 
void FbWindow::showSubwindows() {
409
 
    XMapSubwindows(display(), m_window);
410
 
}
411
 
 
412
 
void FbWindow::hide() {
413
 
    XUnmapWindow(display(), m_window);
414
 
}
415
 
 
416
 
void FbWindow::lower() {
417
 
    XLowerWindow(display(), window());
418
 
}
419
 
 
420
 
void FbWindow::raise() {
421
 
    XRaiseWindow(display(), window());
422
 
}
423
 
 
424
 
void FbWindow::setInputFocus(int revert_to, int time) {
425
 
    XSetInputFocus(display(), window(), revert_to, time);
426
 
}
427
 
 
428
 
void FbWindow::setCursor(Cursor cur) {
429
 
    XDefineCursor(display(), window(), cur);
430
 
}
431
 
 
432
 
void FbWindow::unsetCursor() {
433
 
    XUndefineCursor(display(), window());
434
 
}
435
 
 
436
 
void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) {
437
 
    XReparentWindow(display(), window(), parent.window(), x, y);
438
 
    m_parent = &parent;
439
 
    if (continuing) // we will continue managing this window after reparent
440
 
        updateGeometry();
441
 
}
442
 
 
443
 
std::string FbWindow::textProperty(Atom property) const {
444
 
    XTextProperty text_prop;
445
 
    char ** stringlist;
446
 
    int count;
447
 
    std::string ret;
448
 
 
449
 
    if (XGetTextProperty(display(), window(), &text_prop, property) == 0)
450
 
        return "";
451
 
 
452
 
    if (text_prop.value == 0 || text_prop.nitems == 0)
453
 
        return "";
454
 
 
455
 
    if (text_prop.encoding != XA_STRING) {
456
 
        // still returns a "StringList" despite the different name
457
 
        if (XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count) == 0 || count == 0)
458
 
            return "";
459
 
    } else {
460
 
        if (XTextPropertyToStringList(&text_prop, &stringlist, &count) == 0 || count == 0)
461
 
            return "";
462
 
 
463
 
    }
464
 
 
465
 
    ret = stringlist[0];
466
 
    XFreeStringList(stringlist);
467
 
    return ret;
468
 
}
469
 
 
470
 
bool FbWindow::property(Atom property,
471
 
                        long long_offset, long long_length,
472
 
                        bool do_delete,
473
 
                        Atom req_type,
474
 
                        Atom *actual_type_return,
475
 
                        int *actual_format_return,
476
 
                        unsigned long *nitems_return,
477
 
                        unsigned long *bytes_after_return,
478
 
                        unsigned char **prop_return) const {
479
 
    if (XGetWindowProperty(display(), window(),
480
 
                           property, long_offset, long_length, do_delete,
481
 
                           req_type, actual_type_return,
482
 
                           actual_format_return, nitems_return,
483
 
                           bytes_after_return, prop_return) == Success)
484
 
        return true;
485
 
 
486
 
    return false;
487
 
}
488
 
 
489
 
void FbWindow::changeProperty(Atom property, Atom type,
490
 
                              int format,
491
 
                              int mode,
492
 
                              unsigned char *data,
493
 
                              int nelements) {
494
 
 
495
 
    XChangeProperty(display(), m_window, property, type,
496
 
                    format, mode,
497
 
                    data, nelements);
498
 
}
499
 
 
500
 
void FbWindow::deleteProperty(Atom property) {
501
 
    XDeleteProperty(display(), m_window, property);
502
 
}
503
 
 
504
 
int FbWindow::screenNumber() const {
505
 
    return m_screen_num;
506
 
}
507
 
 
508
 
long FbWindow::eventMask() const {
509
 
    XWindowAttributes attrib;
510
 
    XGetWindowAttributes(display(), window(),
511
 
                         &attrib);
512
 
    return attrib.your_event_mask;
513
 
 
514
 
}
515
 
 
516
 
void FbWindow::setOpaque(unsigned char alpha) {
517
 
#ifdef HAVE_XRENDER
518
 
    static Atom m_alphaatom = XInternAtom(display(), "_NET_WM_WINDOW_OPACITY", False);
519
 
    unsigned int opacity = alpha << 24;
520
 
    changeProperty(m_alphaatom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1l);
521
 
#endif // HAVE_XRENDER
522
 
}
523
 
 
524
 
void FbWindow::updateGeometry() {
525
 
    if (m_window == 0)
526
 
        return;
527
 
 
528
 
    Window root;
529
 
    unsigned int border_width, depth;
530
 
    XGetGeometry(display(), m_window, &root, &m_x, &m_y,
531
 
                 (unsigned int *)&m_width, (unsigned int *)&m_height,
532
 
                 &border_width, &depth);
533
 
    m_depth = depth;
534
 
}
535
 
 
536
 
void FbWindow::create(Window parent, int x, int y,
537
 
                      unsigned int width, unsigned int height,
538
 
                      long eventmask, bool override_redirect,
539
 
                      bool save_unders, int depth, int class_type) {
540
 
 
541
 
 
542
 
    m_border_width = 0;
543
 
 
544
 
    long valmask = CWEventMask;
545
 
    XSetWindowAttributes values;
546
 
    values.event_mask = eventmask;
547
 
 
548
 
    if (override_redirect) {
549
 
        valmask |= CWOverrideRedirect;
550
 
        values.override_redirect = True;
551
 
    }
552
 
 
553
 
    if (save_unders) {
554
 
        valmask |= CWSaveUnder;
555
 
        values.save_under = True;
556
 
    }
557
 
 
558
 
    m_window = XCreateWindow(display(), parent, x, y, width, height,
559
 
                             0, // border width
560
 
                             depth, // depth
561
 
                             class_type, // class
562
 
                             CopyFromParent, // visual
563
 
                             valmask, // create mask
564
 
                             &values); // create atrribs
565
 
 
566
 
    assert(m_window);
567
 
 
568
 
    updateGeometry();
569
 
}
570
 
 
571
 
 
572
 
void FbWindow::sendConfigureNotify(int x, int y, 
573
 
                                   unsigned int width, unsigned int height) {
574
 
    Display *disp = FbTk::App::instance()->display();
575
 
    XEvent event;
576
 
    event.type = ConfigureNotify;
577
 
 
578
 
    event.xconfigure.display = disp;
579
 
    event.xconfigure.event = window();
580
 
    event.xconfigure.window = window();
581
 
    event.xconfigure.x = x;
582
 
    event.xconfigure.y = y;
583
 
    event.xconfigure.width = width;
584
 
    event.xconfigure.height = height;
585
 
    //!! TODO
586
 
    event.xconfigure.border_width = 1;
587
 
    //!! TODO
588
 
    event.xconfigure.above = None; 
589
 
    event.xconfigure.override_redirect = false;
590
 
 
591
 
    XSendEvent(disp, window(), False, StructureNotifyMask, &event);
592
 
 
593
 
}
594
 
 
595
 
bool operator == (Window win, const FbWindow &fbwin) {
596
 
    return win == fbwin.window();
597
 
}
598
 
 
599
 
};