diff options
author | akir <akir> | 2004-09-10 15:46:08 (GMT) |
---|---|---|
committer | akir <akir> | 2004-09-10 15:46:08 (GMT) |
commit | a7967dfb25c2f6df31e84d3ffdab952d44efaab1 (patch) | |
tree | 65e2e531851c2bff003e2f11400d0c44082d2efd /src/FbTk/FbWindow.cc | |
parent | 631dfbbc6377b0338b56131e51b37fe836ff96bf (diff) | |
download | fluxbox-a7967dfb25c2f6df31e84d3ffdab952d44efaab1.zip fluxbox-a7967dfb25c2f6df31e84d3ffdab952d44efaab1.tar.bz2 |
put App::instance()->display() to FbDrawable::s_display to avoid too much
unnecessary calls
Diffstat (limited to 'src/FbTk/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 5417c09..ea84701 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -19,7 +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 | // $Id: FbWindow.cc,v 1.38 2004/09/09 14:29:10 akir Exp $ | 22 | // $Id: FbWindow.cc,v 1.39 2004/09/10 15:46:08 akir Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | #include "FbPixmap.hh" | 25 | #include "FbPixmap.hh" |
@@ -44,14 +44,10 @@ | |||
44 | 44 | ||
45 | namespace FbTk { | 45 | namespace FbTk { |
46 | 46 | ||
47 | Display *FbWindow::s_display = 0; | 47 | FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), |
48 | |||
49 | FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), | ||
50 | m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true), | 48 | m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true), |
51 | m_buffer_pm(0) { | 49 | m_buffer_pm(0){ |
52 | 50 | ||
53 | if (s_display == 0) | ||
54 | s_display = App::instance()->display(); | ||
55 | } | 51 | } |
56 | 52 | ||
57 | FbWindow::FbWindow(const FbWindow& the_copy):m_parent(the_copy.parent()), | 53 | FbWindow::FbWindow(const FbWindow& the_copy):m_parent(the_copy.parent()), |
@@ -61,9 +57,6 @@ FbWindow::FbWindow(const FbWindow& the_copy):m_parent(the_copy.parent()), | |||
61 | m_border_width(the_copy.borderWidth()), | 57 | m_border_width(the_copy.borderWidth()), |
62 | m_depth(the_copy.depth()), m_destroy(true), | 58 | m_depth(the_copy.depth()), m_destroy(true), |
63 | m_buffer_pm(0) { | 59 | m_buffer_pm(0) { |
64 | if (s_display == 0) | ||
65 | s_display = App::instance()->display(); | ||
66 | |||
67 | the_copy.m_window = 0; | 60 | the_copy.m_window = 0; |
68 | } | 61 | } |
69 | 62 | ||
@@ -75,12 +68,13 @@ FbWindow::FbWindow(int screen_num, | |||
75 | bool save_unders, | 68 | bool save_unders, |
76 | int depth, | 69 | int depth, |
77 | int class_type): | 70 | int class_type): |
71 | FbDrawable(), | ||
78 | m_parent(0), | 72 | m_parent(0), |
79 | m_screen_num(screen_num), | 73 | m_screen_num(screen_num), |
80 | m_destroy(true), | 74 | m_destroy(true), |
81 | m_buffer_pm(0) { | 75 | m_buffer_pm(0) { |
82 | 76 | ||
83 | create(RootWindow(FbTk::App::instance()->display(), screen_num), | 77 | create(RootWindow(s_display, screen_num), |
84 | x, y, width, height, eventmask, | 78 | x, y, width, height, eventmask, |
85 | override_redirect, save_unders, depth, class_type); | 79 | override_redirect, save_unders, depth, class_type); |
86 | }; | 80 | }; |
@@ -102,7 +96,7 @@ FbWindow::FbWindow(const FbWindow &parent, | |||
102 | 96 | ||
103 | }; | 97 | }; |
104 | 98 | ||
105 | FbWindow::FbWindow(Window client):m_parent(0), | 99 | FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0), |
106 | m_screen_num(0), | 100 | m_screen_num(0), |
107 | m_window(0), | 101 | m_window(0), |
108 | m_x(0), m_y(0), | 102 | m_x(0), m_y(0), |
@@ -112,9 +106,6 @@ FbWindow::FbWindow(Window client):m_parent(0), | |||
112 | m_destroy(false), // don't destroy this window | 106 | m_destroy(false), // don't destroy this window |
113 | m_buffer_pm(0) { | 107 | m_buffer_pm(0) { |
114 | 108 | ||
115 | if (s_display == 0) | ||
116 | s_display = App::instance()->display(); | ||
117 | |||
118 | setNew(client); | 109 | setNew(client); |
119 | } | 110 | } |
120 | 111 | ||
@@ -258,8 +249,6 @@ FbWindow &FbWindow::operator = (Window win) { | |||
258 | } | 249 | } |
259 | 250 | ||
260 | void FbWindow::setNew(Window win) { | 251 | void FbWindow::setNew(Window win) { |
261 | if (s_display == 0) | ||
262 | s_display = App::instance()->display(); | ||
263 | 252 | ||
264 | if (m_window != 0 && m_destroy) | 253 | if (m_window != 0 && m_destroy) |
265 | XDestroyWindow(s_display, m_window); | 254 | XDestroyWindow(s_display, m_window); |
@@ -423,9 +412,6 @@ void FbWindow::create(Window parent, int x, int y, | |||
423 | bool save_unders, int depth, int class_type) { | 412 | bool save_unders, int depth, int class_type) { |
424 | 413 | ||
425 | 414 | ||
426 | if (s_display == 0) | ||
427 | s_display = FbTk::App::instance()->display(); | ||
428 | |||
429 | m_border_width = 0; | 415 | m_border_width = 0; |
430 | 416 | ||
431 | long valmask = CWEventMask; | 417 | long valmask = CWEventMask; |