diff options
author | Gediminas Liktaras <gliktaras@gmail.com> | 2011-10-20 07:41:25 (GMT) |
---|---|---|
committer | Mathias Gumz <mathias gumz at gmail com> | 2011-10-20 07:41:55 (GMT) |
commit | 12f44680dfefde602f3387c6d385f4c5e68990e4 (patch) | |
tree | a340aa064066988b6425009d961a3f971f3d3d4f /src/FbTk | |
parent | b2b65dea7f766942f1a7a7e34b8815c5dbb996a8 (diff) | |
download | fluxbox_pavel-12f44680dfefde602f3387c6d385f4c5e68990e4.zip fluxbox_pavel-12f44680dfefde602f3387c6d385f4c5e68990e4.tar.bz2 |
Added support for ARGB visual, patch #3284774
fluxbox now properly displays windows that require ARGB visuals when
an external compositor is running. This was done by creating the
container window with the correct visual and colormap when needed.
Closes #2874629
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FbWindow.cc | 29 | ||||
-rw-r--r-- | src/FbTk/FbWindow.hh | 14 |
2 files changed, 30 insertions, 13 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 9fa59fc..8362733 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -77,7 +77,9 @@ FbWindow::FbWindow(int screen_num, | |||
77 | bool override_redirect, | 77 | bool override_redirect, |
78 | bool save_unders, | 78 | bool save_unders, |
79 | unsigned int depth, | 79 | unsigned int depth, |
80 | int class_type): | 80 | int class_type, |
81 | Visual *visual, | ||
82 | Colormap cmap): | ||
81 | FbDrawable(), | 83 | FbDrawable(), |
82 | m_parent(0), | 84 | m_parent(0), |
83 | m_screen_num(screen_num), | 85 | m_screen_num(screen_num), |
@@ -93,7 +95,7 @@ FbWindow::FbWindow(int screen_num, | |||
93 | 95 | ||
94 | create(RootWindow(display(), screen_num), | 96 | create(RootWindow(display(), screen_num), |
95 | x, y, width, height, eventmask, | 97 | x, y, width, height, eventmask, |
96 | override_redirect, save_unders, depth, class_type); | 98 | override_redirect, save_unders, depth, class_type, visual, cmap); |
97 | } | 99 | } |
98 | 100 | ||
99 | FbWindow::FbWindow(const FbWindow &parent, | 101 | FbWindow::FbWindow(const FbWindow &parent, |
@@ -101,7 +103,10 @@ FbWindow::FbWindow(const FbWindow &parent, | |||
101 | long eventmask, | 103 | long eventmask, |
102 | bool override_redirect, | 104 | bool override_redirect, |
103 | bool save_unders, | 105 | bool save_unders, |
104 | unsigned int depth, int class_type): | 106 | unsigned int depth, |
107 | int class_type, | ||
108 | Visual *visual, | ||
109 | Colormap cmap): | ||
105 | FbDrawable(), | 110 | FbDrawable(), |
106 | m_parent(&parent), | 111 | m_parent(&parent), |
107 | m_screen_num(parent.screenNumber()), | 112 | m_screen_num(parent.screenNumber()), |
@@ -113,9 +118,7 @@ FbWindow::FbWindow(const FbWindow &parent, | |||
113 | m_lastbg_pm(0), m_renderer(0) { | 118 | m_lastbg_pm(0), m_renderer(0) { |
114 | 119 | ||
115 | create(parent.window(), x, y, width, height, eventmask, | 120 | create(parent.window(), x, y, width, height, eventmask, |
116 | override_redirect, save_unders, depth, class_type); | 121 | override_redirect, save_unders, depth, class_type, visual, cmap); |
117 | |||
118 | |||
119 | } | 122 | } |
120 | 123 | ||
121 | FbWindow::FbWindow(Window client): | 124 | FbWindow::FbWindow(Window client): |
@@ -634,9 +637,8 @@ bool FbWindow::updateGeometry() { | |||
634 | void FbWindow::create(Window parent, int x, int y, | 637 | void FbWindow::create(Window parent, int x, int y, |
635 | unsigned int width, unsigned int height, | 638 | unsigned int width, unsigned int height, |
636 | long eventmask, bool override_redirect, | 639 | long eventmask, bool override_redirect, |
637 | bool save_unders, unsigned int depth, int class_type) { | 640 | bool save_unders, unsigned int depth, int class_type, |
638 | 641 | Visual *visual, Colormap cmap) { | |
639 | |||
640 | m_border_width = 0; | 642 | m_border_width = 0; |
641 | m_border_color = 0; | 643 | m_border_color = 0; |
642 | 644 | ||
@@ -654,11 +656,18 @@ void FbWindow::create(Window parent, int x, int y, | |||
654 | values.save_under = True; | 656 | values.save_under = True; |
655 | } | 657 | } |
656 | 658 | ||
659 | if (cmap != CopyFromParent) { | ||
660 | valmask |= CWColormap | CWBackPixel | CWBorderPixel; | ||
661 | values.colormap = cmap; | ||
662 | values.background_pixel = XWhitePixel(display(), 0); | ||
663 | values.border_pixel = XBlackPixel(display(), 0); | ||
664 | } | ||
665 | |||
657 | m_window = XCreateWindow(display(), parent, x, y, width, height, | 666 | m_window = XCreateWindow(display(), parent, x, y, width, height, |
658 | 0, // border width | 667 | 0, // border width |
659 | depth, // depth | 668 | depth, // depth |
660 | class_type, // class | 669 | class_type, // class |
661 | CopyFromParent, // visual | 670 | visual, // visual |
662 | valmask, // create mask | 671 | valmask, // create mask |
663 | &values); // create atrribs | 672 | &values); // create atrribs |
664 | 673 | ||
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 6f6a558..e03083c 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -57,7 +57,9 @@ public: | |||
57 | bool overrride_redirect = false, | 57 | bool overrride_redirect = false, |
58 | bool save_unders = false, | 58 | bool save_unders = false, |
59 | unsigned int depth = CopyFromParent, | 59 | unsigned int depth = CopyFromParent, |
60 | int class_type = InputOutput); | 60 | int class_type = InputOutput, |
61 | Visual *visual = CopyFromParent, | ||
62 | Colormap cmap = CopyFromParent); | ||
61 | 63 | ||
62 | FbWindow(const FbWindow &parent, | 64 | FbWindow(const FbWindow &parent, |
63 | int x, int y, | 65 | int x, int y, |
@@ -66,7 +68,9 @@ public: | |||
66 | bool overrride_redirect = false, | 68 | bool overrride_redirect = false, |
67 | bool save_unders = false, | 69 | bool save_unders = false, |
68 | unsigned int depth = CopyFromParent, | 70 | unsigned int depth = CopyFromParent, |
69 | int class_type = InputOutput); | 71 | int class_type = InputOutput, |
72 | Visual *visual = CopyFromParent, | ||
73 | Colormap cmap = CopyFromParent); | ||
70 | 74 | ||
71 | virtual ~FbWindow(); | 75 | virtual ~FbWindow(); |
72 | virtual void setBackgroundColor(const FbTk::Color &bg_color); | 76 | virtual void setBackgroundColor(const FbTk::Color &bg_color); |
@@ -207,6 +211,8 @@ protected: | |||
207 | /// creates a window with x window client (m_window = client) | 211 | /// creates a window with x window client (m_window = client) |
208 | explicit FbWindow(Window client); | 212 | explicit FbWindow(Window client); |
209 | 213 | ||
214 | void setDepth(unsigned int depth) { m_depth = depth; } | ||
215 | |||
210 | private: | 216 | private: |
211 | /// sets new X window and destroys old | 217 | /// sets new X window and destroys old |
212 | void setNew(Window win); | 218 | void setNew(Window win); |
@@ -216,7 +222,9 @@ private: | |||
216 | bool override_redirect, | 222 | bool override_redirect, |
217 | bool save_unders, | 223 | bool save_unders, |
218 | unsigned int depth, | 224 | unsigned int depth, |
219 | int class_type); | 225 | int class_type, |
226 | Visual *visual, | ||
227 | Colormap cmap); | ||
220 | 228 | ||
221 | const FbWindow *m_parent; ///< parent FbWindow | 229 | const FbWindow *m_parent; ///< parent FbWindow |
222 | int m_screen_num; ///< screen num on which this window exist | 230 | int m_screen_num; ///< screen num on which this window exist |