aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-04 22:39:52 (GMT)
committerfluxgen <fluxgen>2002-04-04 22:39:52 (GMT)
commit675f28ad9e6fa12c9470694983c9178422ee98a9 (patch)
tree2b8fec45acdaf56b0e323b1b4db2be2da027d384 /src/Window.cc
parentd78a4ac9a983e6ef20e3ddc97af50a963e35c54d (diff)
downloadfluxbox-675f28ad9e6fa12c9470694983c9178422ee98a9.zip
fluxbox-675f28ad9e6fa12c9470694983c9178422ee98a9.tar.bz2
fixed iconbar update bug
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 8ed85ff..3b0afd8 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,9 @@
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: Window.cc,v 1.39 2002/04/04 14:23:30 fluxgen Exp $ 25// $Id: Window.cc,v 1.40 2002/04/04 22:39:52 fluxgen Exp $
26
27#include "Window.hh"
26 28
27//use GNU extensions 29//use GNU extensions
28#ifndef _GNU_SOURCE 30#ifndef _GNU_SOURCE
@@ -38,7 +40,6 @@
38#include "Icon.hh" 40#include "Icon.hh"
39#include "Screen.hh" 41#include "Screen.hh"
40#include "Toolbar.hh" 42#include "Toolbar.hh"
41#include "Window.hh"
42#include "Windowmenu.hh" 43#include "Windowmenu.hh"
43#include "StringUtil.hh" 44#include "StringUtil.hh"
44 45
@@ -1430,7 +1431,7 @@ void FluxboxWindow::getWMName(void) {
1430 char **list; 1431 char **list;
1431 int num; 1432 int num;
1432 I18n *i18n = I18n::instance(); 1433 I18n *i18n = I18n::instance();
1433 1434
1434 if (XGetWMName(display, client.window, &text_prop)) { 1435 if (XGetWMName(display, client.window, &text_prop)) {
1435 if (text_prop.value && text_prop.nitems > 0) { 1436 if (text_prop.value && text_prop.nitems > 0) {
1436 if (text_prop.encoding != XA_STRING) { 1437 if (text_prop.encoding != XA_STRING) {
@@ -1469,6 +1470,7 @@ void FluxboxWindow::getWMName(void) {
1469 } 1470 }
1470 1471
1471 client.title_text_w += (frame.bevel_w * 4); 1472 client.title_text_w += (frame.bevel_w * 4);
1473
1472} 1474}
1473 1475
1474 1476
@@ -1498,6 +1500,7 @@ void FluxboxWindow::getWMIconName(void) {
1498 client.icon_title = getTitle(); 1500 client.icon_title = getTitle();
1499 } else 1501 } else
1500 client.icon_title = getTitle(); 1502 client.icon_title = getTitle();
1503
1501} 1504}
1502 1505
1503 1506
@@ -2971,6 +2974,7 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) {
2971 case XA_WM_ICON_NAME: 2974 case XA_WM_ICON_NAME:
2972 getWMIconName(); 2975 getWMIconName();
2973 if (iconic) screen->iconUpdate(); 2976 if (iconic) screen->iconUpdate();
2977 updateIcon();
2974 break; 2978 break;
2975 2979
2976 case XA_WM_NAME: 2980 case XA_WM_NAME:
@@ -2984,22 +2988,9 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) {
2984 2988
2985 if (! iconic) 2989 if (! iconic)
2986 screen->getWorkspace(workspace_number)->update(); 2990 screen->getWorkspace(workspace_number)->update();
2987 else if (Fluxbox::instance()->useIconBar()) { 2991 else
2988 IconBar *iconbar = 0; 2992 updateIcon();
2989 IconBarObj *icon = 0; 2993
2990 if ((iconbar = screen->getToolbar()->getIconBar()) != 0) {
2991 if ((icon = iconbar->findIcon(this)) != 0)
2992 iconbar->draw(icon, icon->getWidth());
2993#ifdef DEBUG
2994 else
2995 cerr<<__FILE__<<"("<<__LINE__<<"): can't find icon!"<<endl;
2996#endif //DEBUG
2997 }
2998#ifdef DEBUG
2999 else
3000 cerr<<__FILE__<<"("<<__LINE__<<"): can't find iconbar!"<<endl;
3001#endif //DEBUG
3002 }
3003 2994
3004 break; 2995 break;
3005 2996
@@ -3607,6 +3598,17 @@ void FluxboxWindow::stopResizing(Window win) {
3607 XUngrabPointer(display, CurrentTime); 3598 XUngrabPointer(display, CurrentTime);
3608} 3599}
3609 3600
3601//finds and redraw the icon label
3602void FluxboxWindow::updateIcon() {
3603 if (Fluxbox::instance()->useIconBar()) {
3604 IconBar *iconbar = 0;
3605 IconBarObj *icon = 0;
3606 if ((iconbar = screen->getToolbar()->getIconBar()) != 0) {
3607 if ((icon = iconbar->findIcon(this)) != 0)
3608 iconbar->draw(icon, icon->getWidth());
3609 }
3610 }
3611}
3610 3612
3611void FluxboxWindow::restore(void) { 3613void FluxboxWindow::restore(void) {
3612 XChangeSaveSet(display, client.window, SetModeDelete); 3614 XChangeSaveSet(display, client.window, SetModeDelete);