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/FbWindow.cc | |
parent | b2b65dea7f766942f1a7a7e34b8815c5dbb996a8 (diff) | |
download | fluxbox-12f44680dfefde602f3387c6d385f4c5e68990e4.zip fluxbox-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/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 29 |
1 files changed, 19 insertions, 10 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 | ||