diff options
author | rathnor <rathnor> | 2004-09-11 12:33:14 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-09-11 12:33:14 (GMT) |
commit | 7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8 (patch) | |
tree | ad753983b54d61f8a01fb32794d67bf50585789e /src/FbTk | |
parent | c8f9cf1177b6de1cc210f0706dae302b9aa4f7b5 (diff) | |
download | fluxbox_paul-7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8.zip fluxbox_paul-7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8.tar.bz2 |
fix issues that resulted in unnecessary X errors
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FbPixmap.cc | 22 | ||||
-rw-r--r-- | src/FbTk/FbWindow.cc | 7 | ||||
-rw-r--r-- | src/FbTk/FbWindow.hh | 4 | ||||
-rw-r--r-- | src/FbTk/Menu.cc | 14 |
4 files changed, 25 insertions, 22 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index 43e74d8..66eee21 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.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: FbPixmap.cc,v 1.14 2004/09/10 15:46:08 akir Exp $ | 22 | // $Id: FbPixmap.cc,v 1.15 2004/09/11 12:33:14 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbPixmap.hh" | 24 | #include "FbPixmap.hh" |
25 | #include "App.hh" | 25 | #include "App.hh" |
@@ -305,28 +305,26 @@ Pixmap FbPixmap::getRootPixmap(int screen_num) { | |||
305 | }; | 305 | }; |
306 | 306 | ||
307 | Pixmap root_pm = None; | 307 | Pixmap root_pm = None; |
308 | |||
309 | for (prop = 0; prop_ids[prop]; prop++) { | 308 | for (prop = 0; prop_ids[prop]; prop++) { |
310 | if (XGetWindowProperty(s_display, | 309 | if (XGetWindowProperty(s_display, |
311 | RootWindow(s_display, screen_num), | 310 | RootWindow(s_display, screen_num), |
312 | XInternAtom(s_display, prop_ids[prop], False), | 311 | XInternAtom(s_display, prop_ids[prop], False), |
313 | 0L, 4, | 312 | 0l, 4l, |
314 | False, XA_PIXMAP, | 313 | False, XA_PIXMAP, |
315 | &real_type, &real_format, | 314 | &real_type, &real_format, |
316 | &items_read, &items_left, | 315 | &items_read, &items_left, |
317 | (unsigned char **) &data) == Success && | 316 | (unsigned char **) &data) == Success) { |
318 | real_format == 32 && items_read == 1) { | 317 | if (real_format == 32 && items_read == 1) { |
319 | 318 | ||
320 | if (strcmp(prop_ids[prop], "_XSETROOT_ID") == 0) { | 319 | if (print_error && strcmp(prop_ids[prop], "_XSETROOT_ID") == 0) { |
321 | if (print_error) { | ||
322 | fprintf(stderr, "%s", error_message); | 320 | fprintf(stderr, "%s", error_message); |
323 | print_error = false; | 321 | print_error = false; |
324 | } | 322 | } else |
325 | } else | 323 | root_pm = (Pixmap) (*data); |
326 | root_pm = (Pixmap) (*data); | 324 | } |
327 | |||
328 | XFree(data); | 325 | XFree(data); |
329 | break; | 326 | if (root_pm != None) |
327 | break; | ||
330 | } | 328 | } |
331 | } | 329 | } |
332 | 330 | ||
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index ea84701..2a4aafa 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.39 2004/09/10 15:46:08 akir Exp $ | 22 | // $Id: FbWindow.cc,v 1.40 2004/09/11 12:33:14 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | #include "FbPixmap.hh" | 25 | #include "FbPixmap.hh" |
@@ -315,10 +315,11 @@ void FbWindow::unsetCursor() { | |||
315 | XUndefineCursor(s_display, window()); | 315 | XUndefineCursor(s_display, window()); |
316 | } | 316 | } |
317 | 317 | ||
318 | void FbWindow::reparent(const FbWindow &parent, int x, int y) { | 318 | void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { |
319 | XReparentWindow(s_display, window(), parent.window(), x, y); | 319 | XReparentWindow(s_display, window(), parent.window(), x, y); |
320 | m_parent = &parent; | 320 | m_parent = &parent; |
321 | updateGeometry(); | 321 | if (continuing) // we will continue managing this window after reparent |
322 | updateGeometry(); | ||
322 | } | 323 | } |
323 | 324 | ||
324 | std::string FbWindow::textProperty(Atom property) const { | 325 | std::string FbWindow::textProperty(Atom property) const { |
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 36b39be..c39b8c1 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -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.hh,v 1.33 2004/09/10 15:46:08 akir Exp $ | 22 | // $Id: FbWindow.hh,v 1.34 2004/09/11 12:33:14 rathnor Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_FBWINDOW_HH | 24 | #ifndef FBTK_FBWINDOW_HH |
25 | #define FBTK_FBWINDOW_HH | 25 | #define FBTK_FBWINDOW_HH |
@@ -119,7 +119,7 @@ public: | |||
119 | void setCursor(Cursor cur); | 119 | void setCursor(Cursor cur); |
120 | /// uses the parents cursor instead | 120 | /// uses the parents cursor instead |
121 | void unsetCursor(); | 121 | void unsetCursor(); |
122 | void reparent(const FbWindow &parent, int x, int y); | 122 | void reparent(const FbWindow &parent, int x, int y, bool continuing = true); |
123 | 123 | ||
124 | bool property(Atom property, | 124 | bool property(Atom property, |
125 | long long_offset, long long_length, | 125 | long long_offset, long long_length, |
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index a1fdf8c..c784498 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Menu.cc,v 1.80 2004/09/09 14:29:10 akir Exp $ | 25 | // $Id: Menu.cc,v 1.81 2004/09/11 12:33:14 rathnor Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -433,7 +433,7 @@ void Menu::update(int active_index) { | |||
433 | } | 433 | } |
434 | 434 | ||
435 | int itmp = (theme().itemHeight() * menu.persub); | 435 | int itmp = (theme().itemHeight() * menu.persub); |
436 | menu.frame_h = itmp < 0 ? 0 : itmp; | 436 | menu.frame_h = itmp < 1 ? 1 : itmp; |
437 | 437 | ||
438 | int new_width = (menu.sublevels * menu.item_w); | 438 | int new_width = (menu.sublevels * menu.item_w); |
439 | int new_height = menu.frame_h; | 439 | int new_height = menu.frame_h; |
@@ -442,8 +442,12 @@ void Menu::update(int active_index) { | |||
442 | new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); | 442 | new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); |
443 | 443 | ||
444 | 444 | ||
445 | if (new_width < 1) | 445 | if (new_width < 1) { |
446 | new_width = menu.item_w; | 446 | if (menu.item_w > 0) |
447 | new_width = menu.item_w; | ||
448 | else | ||
449 | new_width = 1; | ||
450 | } | ||
447 | 451 | ||
448 | if (new_height < 1) | 452 | if (new_height < 1) |
449 | new_height = 1; | 453 | new_height = 1; |
@@ -548,7 +552,7 @@ void Menu::update(int active_index) { | |||
548 | } | 552 | } |
549 | 553 | ||
550 | menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + | 554 | menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + |
551 | menu.title.borderWidth()*2 : 0), | 555 | menu.title.borderWidth()*2 : 1), |
552 | width(), menu.frame_h); | 556 | width(), menu.frame_h); |
553 | 557 | ||
554 | 558 | ||