aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGediminas Liktaras <gliktaras@gmail.com>2011-12-08 13:34:09 (GMT)
committerPaul Tagliamonte <paultag@ubuntu.com>2011-12-08 13:34:09 (GMT)
commit63a82c3b1af803dbedc284830be2976ec4dc8e61 (patch)
treed3a13e346ae79aa4df1003dde9bcd36dd4f91359 /src
parent2223c879bf41d2b4f40fa43db478ba1bce8523de (diff)
downloadfluxbox_paul-63a82c3b1af803dbedc284830be2976ec4dc8e61.zip
fluxbox_paul-63a82c3b1af803dbedc284830be2976ec4dc8e61.tar.bz2
fbcompose - A compositing addon for fluxbox window manager.
fbcompose(1) is an optional compositing addon for fluxbox window manager. It augments fluxbox with a number of graphical features. Most notably, fbcompose allows fluxbox to properly display applications that require compositing (docky, for example), adds support for true window transparency (as opposed to fluxbox's pseudo transparency) and provides a plugin framework to extend the compositor's functionality. As this is still a beta version of the compositor, the bugs are likely.
Diffstat (limited to 'src')
-rw-r--r--src/FbAtoms.cc2
-rw-r--r--src/FbAtoms.hh4
-rw-r--r--src/FbTk/FbWindow.cc11
-rw-r--r--src/IconButton.cc9
-rw-r--r--src/IconButton.hh2
-rw-r--r--src/Window.cc25
-rw-r--r--src/Window.hh3
7 files changed, 50 insertions, 6 deletions
diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc
index 409a99f..95a89a7 100644
--- a/src/FbAtoms.cc
+++ b/src/FbAtoms.cc
@@ -40,6 +40,8 @@ FbAtoms::FbAtoms() {
40 motif_wm_hints = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); 40 motif_wm_hints = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
41 41
42 blackbox_attributes = XInternAtom(dpy, "_BLACKBOX_ATTRIBUTES", False); 42 blackbox_attributes = XInternAtom(dpy, "_BLACKBOX_ATTRIBUTES", False);
43 current_iconbar_item = XInternAtom(dpy, "_FLUXBOX_CURRENT_ICONBAR_ITEM", False);
44 resize_rect = XInternAtom(dpy, "_FLUXBOX_RECONFIGURE_RECT", False);
43 45
44 s_singleton = this; 46 s_singleton = this;
45} 47}
diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh
index 3ed52a5..09920f3 100644
--- a/src/FbAtoms.hh
+++ b/src/FbAtoms.hh
@@ -42,12 +42,16 @@ public:
42 // these atoms are for normal app->WM interaction beyond the scope of the 42 // these atoms are for normal app->WM interaction beyond the scope of the
43 // ICCCM... 43 // ICCCM...
44 Atom getFluxboxAttributesAtom() const { return blackbox_attributes; } 44 Atom getFluxboxAttributesAtom() const { return blackbox_attributes; }
45 Atom getFluxboxCurrentIconbarItemAtom() const { return current_iconbar_item; }
46 Atom getFluxboxResizeRectAtom() const { return resize_rect; }
45 47
46private: 48private:
47 FbAtoms(); 49 FbAtoms();
48 50
49 Atom blackbox_attributes; 51 Atom blackbox_attributes;
52 Atom current_iconbar_item;
50 Atom motif_wm_hints; 53 Atom motif_wm_hints;
54 Atom resize_rect;
51 Atom xa_wm_protocols; 55 Atom xa_wm_protocols;
52 Atom xa_wm_state; 56 Atom xa_wm_state;
53 Atom xa_wm_delete_window; 57 Atom xa_wm_delete_window;
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 8362733..cf2d348 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -64,7 +64,7 @@ FbWindow::FbWindow(const FbWindow& the_copy):
64 m_width(the_copy.width()), m_height(the_copy.height()), 64 m_width(the_copy.width()), m_height(the_copy.height()),
65 m_border_width(the_copy.borderWidth()), 65 m_border_width(the_copy.borderWidth()),
66 m_border_color(the_copy.borderColor()), 66 m_border_color(the_copy.borderColor()),
67 m_depth(the_copy.depth()), m_destroy(true), 67 m_depth(the_copy.depth()), m_destroy(the_copy.m_destroy),
68 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), 68 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0),
69 m_renderer(the_copy.m_renderer) { 69 m_renderer(the_copy.m_renderer) {
70 the_copy.m_window = 0; 70 the_copy.m_window = 0;
@@ -413,7 +413,6 @@ void FbWindow::setNew(Window win) {
413 m_window = win; 413 m_window = win;
414 414
415 if (m_window != 0) { 415 if (m_window != 0) {
416 updateGeometry();
417 XWindowAttributes attr; 416 XWindowAttributes attr;
418 attr.screen = 0; 417 attr.screen = 0;
419 //get screen number 418 //get screen number
@@ -622,16 +621,16 @@ bool FbWindow::updateGeometry() {
622 return false; 621 return false;
623 622
624 int old_x = m_x, old_y = m_y; 623 int old_x = m_x, old_y = m_y;
625 unsigned int old_width = m_width, old_height = m_height; 624 unsigned int old_border_width = m_border_width, old_width = m_width, old_height = m_height;
626 625
627 Window root; 626 Window root;
628 unsigned int border_width, depth; 627 unsigned int depth;
629 if (XGetGeometry(display(), m_window, &root, &m_x, &m_y, 628 if (XGetGeometry(display(), m_window, &root, &m_x, &m_y,
630 &m_width, &m_height, &border_width, &depth)) 629 &m_width, &m_height, &m_border_width, &depth))
631 m_depth = depth; 630 m_depth = depth;
632 631
633 return (old_x != m_x || old_y != m_y || old_width != m_width || 632 return (old_x != m_x || old_y != m_y || old_width != m_width ||
634 old_height != m_height); 633 old_height != m_height || old_border_width != m_border_width);
635} 634}
636 635
637void FbWindow::create(Window parent, int x, int y, 636void FbWindow::create(Window parent, int x, int y,
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 7c70a63..6e7294e 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -24,7 +24,9 @@
24#include "IconbarTool.hh" 24#include "IconbarTool.hh"
25#include "IconbarTheme.hh" 25#include "IconbarTheme.hh"
26 26
27#include "FbAtoms.hh"
27#include "Screen.hh" 28#include "Screen.hh"
29#include "Window.hh"
28 30
29#include "FbTk/App.hh" 31#include "FbTk/App.hh"
30#include "FbTk/Command.hh" 32#include "FbTk/Command.hh"
@@ -36,6 +38,7 @@
36#include "config.h" 38#include "config.h"
37#endif // HAVE_CONFIG_H 39#endif // HAVE_CONFIG_H
38 40
41#include <X11/Xatom.h>
39#include <X11/Xutil.h> 42#include <X11/Xutil.h>
40#ifdef SHAPE 43#ifdef SHAPE
41#include <X11/extensions/shape.h> 44#include <X11/extensions/shape.h>
@@ -86,11 +89,13 @@ void IconButton::exposeEvent(XExposeEvent &event) {
86 89
87void IconButton::enterNotifyEvent(XCrossingEvent &ev) { 90void IconButton::enterNotifyEvent(XCrossingEvent &ev) {
88 m_has_tooltip = true; 91 m_has_tooltip = true;
92 setCurrentIconbarItem(m_win.fbwindow()->clientWindow());
89 showTooltip(); 93 showTooltip();
90} 94}
91 95
92void IconButton::leaveNotifyEvent(XCrossingEvent &ev) { 96void IconButton::leaveNotifyEvent(XCrossingEvent &ev) {
93 m_has_tooltip = false; 97 m_has_tooltip = false;
98 setCurrentIconbarItem(None);
94 m_win.screen().hideTooltip(); 99 m_win.screen().hideTooltip();
95} 100}
96 101
@@ -282,3 +287,7 @@ bool IconButton::setOrientation(FbTk::Orientation orient) {
282 } 287 }
283} 288}
284 289
290void IconButton::setCurrentIconbarItem(Window xid) {
291 m_win.screen().rootWindow().changeProperty(FbAtoms::instance()->getFluxboxCurrentIconbarItemAtom(),
292 XA_WINDOW, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&xid), 1);
293}
diff --git a/src/IconButton.hh b/src/IconButton.hh
index 36781d1..3f0d1e3 100644
--- a/src/IconButton.hh
+++ b/src/IconButton.hh
@@ -77,6 +77,8 @@ private:
77 /// Called when client title changed. 77 /// Called when client title changed.
78 void clientTitleChanged(); 78 void clientTitleChanged();
79 79
80 void setCurrentIconbarItem(Window xid);
81
80 Focusable &m_win; 82 Focusable &m_win;
81 FbTk::FbWindow m_icon_window; 83 FbTk::FbWindow m_icon_window;
82 FbTk::FbPixmap m_icon_pixmap; 84 FbTk::FbPixmap m_icon_pixmap;
diff --git a/src/Window.cc b/src/Window.cc
index db5bacc..6bd075d 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1876,6 +1876,16 @@ bool FluxboxWindow::getState() {
1876 return ret; 1876 return ret;
1877} 1877}
1878 1878
1879void FluxboxWindow::setReconfigureRectProperty(int x, int y, int width, int height) {
1880 long data[4] = { x, y, width, height };
1881 winClient().screen().rootWindow().changeProperty(FbAtoms::instance()->getFluxboxResizeRectAtom(),
1882 XA_CARDINAL, 32, PropModeReplace, reinterpret_cast<unsigned char*>(data), 4);
1883}
1884
1885void FluxboxWindow::clearReconfigureRectProperty() {
1886 setReconfigureRectProperty(0, 0, 0, 0);
1887}
1888
1879/** 1889/**
1880 Show the window menu at pos x, y 1890 Show the window menu at pos x, y
1881*/ 1891*/
@@ -2573,6 +2583,10 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2573 m_last_resize_w - 1 + 2 * frame().window().borderWidth(), 2583 m_last_resize_w - 1 + 2 * frame().window().borderWidth(),
2574 m_last_resize_h - 1 + 2 * frame().window().borderWidth()); 2584 m_last_resize_h - 1 + 2 * frame().window().borderWidth());
2575 2585
2586 setReconfigureRectProperty(m_last_resize_x, m_last_resize_y,
2587 m_last_resize_w + 2 * frame().window().borderWidth() - 1,
2588 m_last_resize_h + 2 * frame().window().borderWidth() - 1);
2589
2576 } 2590 }
2577 } else if (m_attaching_tab != 0) { 2591 } else if (m_attaching_tab != 0) {
2578 // 2592 //
@@ -2590,6 +2604,8 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2590 dx, dy, 2604 dx, dy,
2591 m_last_resize_w, m_last_resize_h); 2605 m_last_resize_w, m_last_resize_h);
2592 2606
2607 setReconfigureRectProperty(dx, dy, m_last_resize_w, m_last_resize_h);
2608
2593 // change remembered position of rectangle 2609 // change remembered position of rectangle
2594 m_last_move_x = dx; 2610 m_last_move_x = dx;
2595 m_last_move_y = dy; 2611 m_last_move_y = dy;
@@ -3083,6 +3099,10 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) {
3083 m_last_resize_x, m_last_resize_y, 3099 m_last_resize_x, m_last_resize_y,
3084 m_last_resize_w - 1 + 2 * frame().window().borderWidth(), 3100 m_last_resize_w - 1 + 2 * frame().window().borderWidth(),
3085 m_last_resize_h - 1 + 2 * frame().window().borderWidth()); 3101 m_last_resize_h - 1 + 2 * frame().window().borderWidth());
3102
3103 setReconfigureRectProperty(m_last_resize_x, m_last_resize_y,
3104 m_last_resize_w + 2 * frame().window().borderWidth() - 1,
3105 m_last_resize_h + 2 * frame().window().borderWidth() - 1);
3086} 3106}
3087 3107
3088void FluxboxWindow::stopResizing(bool interrupted) { 3108void FluxboxWindow::stopResizing(bool interrupted) {
@@ -3103,6 +3123,7 @@ void FluxboxWindow::stopResizing(bool interrupted) {
3103 } 3123 }
3104 3124
3105 ungrabPointer(CurrentTime); 3125 ungrabPointer(CurrentTime);
3126 clearReconfigureRectProperty();
3106} 3127}
3107 3128
3108WinClient* FluxboxWindow::winClientOfLabelButtonWindow(Window window) { 3129WinClient* FluxboxWindow::winClientOfLabelButtonWindow(Window window) {
@@ -3159,6 +3180,8 @@ void FluxboxWindow::startTabbing(const XButtonEvent &be) {
3159 m_last_resize_w, m_last_resize_h); 3180 m_last_resize_w, m_last_resize_h);
3160 3181
3161 menu().hide(); 3182 menu().hide();
3183
3184 setReconfigureRectProperty(m_last_move_x, m_last_move_y, m_last_resize_w, m_last_resize_h);
3162} 3185}
3163 3186
3164void FluxboxWindow::attachTo(int x, int y, bool interrupted) { 3187void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
@@ -3169,6 +3192,8 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3169 m_last_move_x, m_last_move_y, 3192 m_last_move_x, m_last_move_y,
3170 m_last_resize_w, m_last_resize_h); 3193 m_last_resize_w, m_last_resize_h);
3171 3194
3195 clearReconfigureRectProperty();
3196
3172 ungrabPointer(CurrentTime); 3197 ungrabPointer(CurrentTime);
3173 3198
3174 Fluxbox::instance()->ungrab(); 3199 Fluxbox::instance()->ungrab();
diff --git a/src/Window.hh b/src/Window.hh
index a5bcb66..3284cf1 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -498,6 +498,9 @@ private:
498 void setFullscreenLayer(); 498 void setFullscreenLayer();
499 void attachWorkAreaSig(); 499 void attachWorkAreaSig();
500 500
501 void setReconfigureRectProperty(int x, int y, int width, int height);
502 void clearReconfigureRectProperty();
503
501 // modifies left and top if snap is necessary 504 // modifies left and top if snap is necessary
502 void doSnapping(int &left, int &top); 505 void doSnapping(int &left, int &top);
503 // user_w/h return the values that should be shown to the user 506 // user_w/h return the values that should be shown to the user