diff options
author | fluxgen <fluxgen> | 2002-02-04 06:57:26 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-02-04 06:57:26 (GMT) |
commit | caa40d71dfd871d9b1d5dc2bac88e9f17050dec7 (patch) | |
tree | 2cf638451096c5e44676f3540bb316bcca06e02b /src | |
parent | 7b175210c8389d1a0715dfe6f04c2049f9c6a7b8 (diff) | |
download | fluxbox-caa40d71dfd871d9b1d5dc2bac88e9f17050dec7.zip fluxbox-caa40d71dfd871d9b1d5dc2bac88e9f17050dec7.tar.bz2 |
fixed MapNotify event
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index a45f4e4..2f2b7af 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.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: fluxbox.cc,v 1.25 2002/02/02 19:51:15 pekdon Exp $ | 25 | // $Id: fluxbox.cc,v 1.26 2002/02/04 06:57:26 fluxgen Exp $ |
26 | 26 | ||
27 | //Use some GNU extensions | 27 | //Use some GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -237,7 +237,7 @@ std::string Resource<std::string>:: | |||
237 | getString() { return **this; } | 237 | getString() { return **this; } |
238 | 238 | ||
239 | template<> | 239 | template<> |
240 | string Resource<Fluxbox::TitlebarList>:: | 240 | std::string Resource<Fluxbox::TitlebarList>:: |
241 | getString() { | 241 | getString() { |
242 | string retval; | 242 | string retval; |
243 | int size=m_value.size(); | 243 | int size=m_value.size(); |
@@ -701,6 +701,9 @@ void Fluxbox::process_event(XEvent *e) { | |||
701 | 701 | ||
702 | case MapNotify: | 702 | case MapNotify: |
703 | { | 703 | { |
704 | #ifdef DEBUG | ||
705 | cerr<<__FILE__<<"("<<__LINE__<<"): MapNotify:"<<hex<<e->xmap.window<<endl; | ||
706 | #endif | ||
704 | FluxboxWindow *win = searchWindow(e->xmap.window); | 707 | FluxboxWindow *win = searchWindow(e->xmap.window); |
705 | 708 | ||
706 | if (win) | 709 | if (win) |
@@ -711,6 +714,9 @@ void Fluxbox::process_event(XEvent *e) { | |||
711 | 714 | ||
712 | case UnmapNotify: | 715 | case UnmapNotify: |
713 | { | 716 | { |
717 | #ifdef DEBUG | ||
718 | cerr<<__FILE__<<"("<<__LINE__<<"): UnmapNotify:"<<hex<<e->xunmap.window<<endl; | ||
719 | #endif | ||
714 | FluxboxWindow *win = (FluxboxWindow *) 0; | 720 | FluxboxWindow *win = (FluxboxWindow *) 0; |
715 | 721 | ||
716 | #ifdef SLIT | 722 | #ifdef SLIT |
@@ -718,8 +724,11 @@ void Fluxbox::process_event(XEvent *e) { | |||
718 | #endif // SLIT | 724 | #endif // SLIT |
719 | 725 | ||
720 | if ((win = searchWindow(e->xunmap.window))) { | 726 | if ((win = searchWindow(e->xunmap.window))) { |
721 | win->unmapNotifyEvent(&e->xunmap); | 727 | // only process windows with StructureNotify selected |
722 | 728 | // (ignore SubstructureNotify) | |
729 | // if (win->windowFor(e->xunmap.window)) | ||
730 | if (win->getClientWindow()!=e->xunmap.window) | ||
731 | win->unmapNotifyEvent(&e->xunmap); | ||
723 | #ifdef SLIT | 732 | #ifdef SLIT |
724 | } else if ((slit = searchSlit(e->xunmap.window))) { | 733 | } else if ((slit = searchSlit(e->xunmap.window))) { |
725 | slit->removeClient(e->xunmap.window); | 734 | slit->removeClient(e->xunmap.window); |
@@ -729,7 +738,8 @@ void Fluxbox::process_event(XEvent *e) { | |||
729 | 738 | ||
730 | break; | 739 | break; |
731 | } | 740 | } |
732 | 741 | case CreateNotify: | |
742 | break; | ||
733 | case DestroyNotify: | 743 | case DestroyNotify: |
734 | { | 744 | { |
735 | FluxboxWindow *win = (FluxboxWindow *) 0; | 745 | FluxboxWindow *win = (FluxboxWindow *) 0; |
@@ -964,6 +974,7 @@ void Fluxbox::process_event(XEvent *e) { | |||
964 | case Keys::RIGHTWORKSPACE: | 974 | case Keys::RIGHTWORKSPACE: |
965 | screen->rightWorkspace(); | 975 | screen->rightWorkspace(); |
966 | break; | 976 | break; |
977 | |||
967 | case Keys::KILLWINDOW: //kill the current window | 978 | case Keys::KILLWINDOW: //kill the current window |
968 | XKillClient(screen->getBaseDisplay()->getXDisplay(), | 979 | XKillClient(screen->getBaseDisplay()->getXDisplay(), |
969 | focused_window->getClientWindow()); | 980 | focused_window->getClientWindow()); |
@@ -1057,6 +1068,10 @@ void Fluxbox::process_event(XEvent *e) { | |||
1057 | 1068 | ||
1058 | case ClientMessage: | 1069 | case ClientMessage: |
1059 | { | 1070 | { |
1071 | #ifdef DEBUG | ||
1072 | cerr<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]="<<e->xclient.data.l[0]<<endl; | ||
1073 | #endif | ||
1074 | |||
1060 | if (e->xclient.format == 32) { | 1075 | if (e->xclient.format == 32) { |
1061 | if (e->xclient.message_type == getWMChangeStateAtom()) { | 1076 | if (e->xclient.message_type == getWMChangeStateAtom()) { |
1062 | FluxboxWindow *win = searchWindow(e->xclient.window); | 1077 | FluxboxWindow *win = searchWindow(e->xclient.window); |
@@ -1101,20 +1116,42 @@ void Fluxbox::process_event(XEvent *e) { | |||
1101 | 1116 | ||
1102 | win->changeBlackboxHints(&net); | 1117 | win->changeBlackboxHints(&net); |
1103 | } | 1118 | } |
1104 | } | 1119 | } |
1105 | #ifdef GNOME | 1120 | #ifdef GNOME |
1106 | else if (e->xclient.message_type == getGnomeWorkspaceAtom()) { | 1121 | else if (e->xclient.message_type == getGnomeWorkspaceAtom()) { |
1107 | #ifdef DEBUG | 1122 | #ifdef DEBUG |
1108 | cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom"<<endl; | 1123 | cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom="<<e->xclient.data.l[0]<<endl; |
1109 | #endif//!DEBUG | 1124 | #endif//!DEBUG |
1110 | BScreen *screen = searchScreen(e->xclient.window); | 1125 | BScreen *screen = 0; |
1111 | if (screen) | 1126 | FluxboxWindow *win = 0; |
1127 | |||
1128 | if ( (win = searchWindow(e->xclient.window))!=0 && | ||
1129 | win->getScreen() && e->xclient.data.l[0] >= 0 && | ||
1130 | e->xclient.data.l[0] < win->getScreen()->getCount()) { | ||
1131 | |||
1132 | win->getScreen()->changeWorkspaceID(e->xclient.data.l[0]); | ||
1133 | |||
1134 | } else if ((screen = searchScreen(e->xclient.window))!=0 && | ||
1135 | e->xclient.data.l[0] >= 0 && | ||
1136 | e->xclient.data.l[0] < screen->getCount()) { | ||
1137 | |||
1112 | screen->changeWorkspaceID(e->xclient.data.l[0]); | 1138 | screen->changeWorkspaceID(e->xclient.data.l[0]); |
1139 | } | ||
1113 | 1140 | ||
1114 | } | 1141 | } |
1115 | #endif //!GNOME | 1142 | #endif //!GNOME |
1116 | } | 1143 | #ifdef NEWWMSPEC |
1144 | else if (e->xclient.message_type == getNETWMDesktopAtom()) { | ||
1145 | BScreen *screen = searchScreen(e->xclient.window); | ||
1117 | 1146 | ||
1147 | if (screen && e->xclient.data.l[0] >= 0 && | ||
1148 | e->xclient.data.l[0] < screen->getCount()) | ||
1149 | screen->changeWorkspaceID(e->xclient.data.l[0]); | ||
1150 | } | ||
1151 | #endif //!NEWWMSPEC | ||
1152 | |||
1153 | } | ||
1154 | |||
1118 | break; | 1155 | break; |
1119 | } | 1156 | } |
1120 | 1157 | ||
@@ -1122,7 +1159,7 @@ void Fluxbox::process_event(XEvent *e) { | |||
1122 | default: | 1159 | default: |
1123 | { | 1160 | { |
1124 | 1161 | ||
1125 | #ifdef SHAPE | 1162 | #ifdef SHAPE |
1126 | if (e->type == getShapeEventBase()) { | 1163 | if (e->type == getShapeEventBase()) { |
1127 | XShapeEvent *shape_event = (XShapeEvent *) e; | 1164 | XShapeEvent *shape_event = (XShapeEvent *) e; |
1128 | FluxboxWindow *win = (FluxboxWindow *) 0; | 1165 | FluxboxWindow *win = (FluxboxWindow *) 0; |
@@ -1131,7 +1168,7 @@ void Fluxbox::process_event(XEvent *e) { | |||
1131 | (shape_event->kind != ShapeBounding)) | 1168 | (shape_event->kind != ShapeBounding)) |
1132 | win->shapeEvent(shape_event); | 1169 | win->shapeEvent(shape_event); |
1133 | } | 1170 | } |
1134 | #endif // SHAPE | 1171 | #endif // SHAPE |
1135 | 1172 | ||
1136 | } | 1173 | } |
1137 | } | 1174 | } |
@@ -2117,6 +2154,7 @@ void Fluxbox::reconfigure(void) { | |||
2117 | 2154 | ||
2118 | 2155 | ||
2119 | void Fluxbox::real_reconfigure(void) { | 2156 | void Fluxbox::real_reconfigure(void) { |
2157 | BaseDisplay::GrabGuard gg(*this); | ||
2120 | grab(); | 2158 | grab(); |
2121 | 2159 | ||
2122 | XrmDatabase new_blackboxrc = (XrmDatabase) 0; | 2160 | XrmDatabase new_blackboxrc = (XrmDatabase) 0; |