fixed MapNotify event

This commit is contained in:
fluxgen 2002-02-04 06:57:26 +00:00
parent 7b175210c8
commit caa40d71df

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: fluxbox.cc,v 1.25 2002/02/02 19:51:15 pekdon Exp $ // $Id: fluxbox.cc,v 1.26 2002/02/04 06:57:26 fluxgen Exp $
//Use some GNU extensions //Use some GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -237,7 +237,7 @@ std::string Resource<std::string>::
getString() { return **this; } getString() { return **this; }
template<> template<>
string Resource<Fluxbox::TitlebarList>:: std::string Resource<Fluxbox::TitlebarList>::
getString() { getString() {
string retval; string retval;
int size=m_value.size(); int size=m_value.size();
@ -701,6 +701,9 @@ void Fluxbox::process_event(XEvent *e) {
case MapNotify: case MapNotify:
{ {
#ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): MapNotify:"<<hex<<e->xmap.window<<endl;
#endif
FluxboxWindow *win = searchWindow(e->xmap.window); FluxboxWindow *win = searchWindow(e->xmap.window);
if (win) if (win)
@ -711,6 +714,9 @@ void Fluxbox::process_event(XEvent *e) {
case UnmapNotify: case UnmapNotify:
{ {
#ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): UnmapNotify:"<<hex<<e->xunmap.window<<endl;
#endif
FluxboxWindow *win = (FluxboxWindow *) 0; FluxboxWindow *win = (FluxboxWindow *) 0;
#ifdef SLIT #ifdef SLIT
@ -718,8 +724,11 @@ void Fluxbox::process_event(XEvent *e) {
#endif // SLIT #endif // SLIT
if ((win = searchWindow(e->xunmap.window))) { if ((win = searchWindow(e->xunmap.window))) {
// only process windows with StructureNotify selected
// (ignore SubstructureNotify)
// if (win->windowFor(e->xunmap.window))
if (win->getClientWindow()!=e->xunmap.window)
win->unmapNotifyEvent(&e->xunmap); win->unmapNotifyEvent(&e->xunmap);
#ifdef SLIT #ifdef SLIT
} else if ((slit = searchSlit(e->xunmap.window))) { } else if ((slit = searchSlit(e->xunmap.window))) {
slit->removeClient(e->xunmap.window); slit->removeClient(e->xunmap.window);
@ -729,7 +738,8 @@ void Fluxbox::process_event(XEvent *e) {
break; break;
} }
case CreateNotify:
break;
case DestroyNotify: case DestroyNotify:
{ {
FluxboxWindow *win = (FluxboxWindow *) 0; FluxboxWindow *win = (FluxboxWindow *) 0;
@ -964,6 +974,7 @@ void Fluxbox::process_event(XEvent *e) {
case Keys::RIGHTWORKSPACE: case Keys::RIGHTWORKSPACE:
screen->rightWorkspace(); screen->rightWorkspace();
break; break;
case Keys::KILLWINDOW: //kill the current window case Keys::KILLWINDOW: //kill the current window
XKillClient(screen->getBaseDisplay()->getXDisplay(), XKillClient(screen->getBaseDisplay()->getXDisplay(),
focused_window->getClientWindow()); focused_window->getClientWindow());
@ -1057,6 +1068,10 @@ void Fluxbox::process_event(XEvent *e) {
case ClientMessage: case ClientMessage:
{ {
#ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]="<<e->xclient.data.l[0]<<endl;
#endif
if (e->xclient.format == 32) { if (e->xclient.format == 32) {
if (e->xclient.message_type == getWMChangeStateAtom()) { if (e->xclient.message_type == getWMChangeStateAtom()) {
FluxboxWindow *win = searchWindow(e->xclient.window); FluxboxWindow *win = searchWindow(e->xclient.window);
@ -1105,14 +1120,36 @@ void Fluxbox::process_event(XEvent *e) {
#ifdef GNOME #ifdef GNOME
else if (e->xclient.message_type == getGnomeWorkspaceAtom()) { else if (e->xclient.message_type == getGnomeWorkspaceAtom()) {
#ifdef DEBUG #ifdef DEBUG
cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom"<<endl; cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom="<<e->xclient.data.l[0]<<endl;
#endif//!DEBUG #endif//!DEBUG
BScreen *screen = searchScreen(e->xclient.window); BScreen *screen = 0;
if (screen) FluxboxWindow *win = 0;
if ( (win = searchWindow(e->xclient.window))!=0 &&
win->getScreen() && e->xclient.data.l[0] >= 0 &&
e->xclient.data.l[0] < win->getScreen()->getCount()) {
win->getScreen()->changeWorkspaceID(e->xclient.data.l[0]);
} else if ((screen = searchScreen(e->xclient.window))!=0 &&
e->xclient.data.l[0] >= 0 &&
e->xclient.data.l[0] < screen->getCount()) {
screen->changeWorkspaceID(e->xclient.data.l[0]); screen->changeWorkspaceID(e->xclient.data.l[0]);
}
} }
#endif //!GNOME #endif //!GNOME
#ifdef NEWWMSPEC
else if (e->xclient.message_type == getNETWMDesktopAtom()) {
BScreen *screen = searchScreen(e->xclient.window);
if (screen && e->xclient.data.l[0] >= 0 &&
e->xclient.data.l[0] < screen->getCount())
screen->changeWorkspaceID(e->xclient.data.l[0]);
}
#endif //!NEWWMSPEC
} }
break; break;
@ -1122,7 +1159,7 @@ void Fluxbox::process_event(XEvent *e) {
default: default:
{ {
#ifdef SHAPE #ifdef SHAPE
if (e->type == getShapeEventBase()) { if (e->type == getShapeEventBase()) {
XShapeEvent *shape_event = (XShapeEvent *) e; XShapeEvent *shape_event = (XShapeEvent *) e;
FluxboxWindow *win = (FluxboxWindow *) 0; FluxboxWindow *win = (FluxboxWindow *) 0;
@ -1131,7 +1168,7 @@ void Fluxbox::process_event(XEvent *e) {
(shape_event->kind != ShapeBounding)) (shape_event->kind != ShapeBounding))
win->shapeEvent(shape_event); win->shapeEvent(shape_event);
} }
#endif // SHAPE #endif // SHAPE
} }
} }
@ -2117,6 +2154,7 @@ void Fluxbox::reconfigure(void) {
void Fluxbox::real_reconfigure(void) { void Fluxbox::real_reconfigure(void) {
BaseDisplay::GrabGuard gg(*this);
grab(); grab();
XrmDatabase new_blackboxrc = (XrmDatabase) 0; XrmDatabase new_blackboxrc = (XrmDatabase) 0;