handleUnmapnotify and gnome stuff
This commit is contained in:
parent
168fe12d69
commit
f6749fb6cd
1 changed files with 81 additions and 104 deletions
141
src/fluxbox.cc
141
src/fluxbox.cc
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: fluxbox.cc,v 1.33 2002/02/16 02:28:11 pekdon Exp $
|
||||
// $Id: fluxbox.cc,v 1.34 2002/02/17 18:43:30 fluxgen Exp $
|
||||
|
||||
//Use some GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -574,33 +574,7 @@ void Fluxbox::process_event(XEvent *e) {
|
|||
|
||||
|
||||
case UnmapNotify:
|
||||
{
|
||||
|
||||
FluxboxWindow *win = 0;
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Unmapnotify 0x"<<hex<<
|
||||
e->xunmap.window<<dec<<endl;
|
||||
#endif
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
|
||||
if ((win = searchWindow(e->xunmap.window))!=0 ) {
|
||||
// only process windows with StructureNotify selected
|
||||
// (ignore SubstructureNotify)
|
||||
// if (win->getClientWindow() != e->xunmap.window ||
|
||||
// win->isTransient()) {
|
||||
win->unmapNotifyEvent(&e->xunmap);
|
||||
// }
|
||||
#ifdef SLIT
|
||||
} else if ((slit = searchSlit(e->xunmap.window))!=0) {
|
||||
slit->removeClient(e->xunmap.window);
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Here"<<endl;
|
||||
#endif
|
||||
#endif // SLIT
|
||||
}
|
||||
}
|
||||
handleUnmapNotify(e->xunmap);
|
||||
break;
|
||||
case CreateNotify:
|
||||
break;
|
||||
|
@ -645,6 +619,7 @@ void Fluxbox::process_event(XEvent *e) {
|
|||
break;
|
||||
case PropertyNotify:
|
||||
{
|
||||
|
||||
last_time = e->xproperty.time;
|
||||
|
||||
if (e->xproperty.state != PropertyDelete) {
|
||||
|
@ -956,6 +931,40 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
|
|||
}
|
||||
}
|
||||
|
||||
void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) {
|
||||
|
||||
|
||||
FluxboxWindow *win = 0;
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Unmapnotify 0x"<<hex<<
|
||||
ue.window<<dec<<endl;
|
||||
#endif
|
||||
|
||||
#ifdef SLIT
|
||||
Slit *slit = (Slit *) 0;
|
||||
#endif // SLIT
|
||||
BScreen *screen = searchScreen(ue.event);
|
||||
|
||||
if ( (ue.event != ue.window) && (screen != 0 || !ue.send_event))
|
||||
return;
|
||||
|
||||
if ( (win = searchWindow(ue.window)) !=0 ) {
|
||||
|
||||
if (win->unmapNotifyEvent(&ue))
|
||||
delete win;
|
||||
|
||||
}
|
||||
#ifdef SLIT
|
||||
else if ((slit = searchSlit(ue.window))!=0) {
|
||||
slit->removeClient(ue.window);
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Here"<<endl;
|
||||
#endif
|
||||
}
|
||||
#endif // SLIT
|
||||
|
||||
}
|
||||
|
||||
//------------ handleClientMessage --------
|
||||
// Handles XClientMessageEvent
|
||||
//-----------------------------------------
|
||||
|
@ -1320,70 +1329,49 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) {
|
|||
// Returns true on success else false
|
||||
//---------------------------------------------
|
||||
bool Fluxbox::checkGnomeAtoms(XClientMessageEvent &ce) {
|
||||
BScreen *screen = 0;
|
||||
FluxboxWindow *win = 0;
|
||||
win = searchWindow(ce.window);
|
||||
screen = searchScreen(ce.window);
|
||||
|
||||
if (ce.message_type == getGnomeWorkspaceAtom()) {
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom="<<ce.data.l[0]<<endl;
|
||||
#endif//!DEBUG
|
||||
BScreen *screen = 0;
|
||||
FluxboxWindow *win = 0;
|
||||
|
||||
if ( (win = searchWindow(ce.window))!=0 && // the message sent to client window?
|
||||
if ( win !=0 && // the message sent to client window?
|
||||
win->getScreen() && ce.data.l[0] >= 0 &&
|
||||
ce.data.l[0] < win->getScreen()->getCount()) {
|
||||
win->getScreen()->changeWorkspaceID(ce.data.l[0]);
|
||||
|
||||
} else if ((screen = searchScreen(ce.window))!=0 && //the message sent to root window?
|
||||
} else if (screen!=0 && //the message sent to root window?
|
||||
ce.data.l[0] >= 0 &&
|
||||
ce.data.l[0] < screen->getCount())
|
||||
screen->changeWorkspaceID(ce.data.l[0]);
|
||||
return true;
|
||||
} else if (win) {
|
||||
|
||||
} else if (ce.message_type == getGnomeStateAtom()) {
|
||||
if (ce.message_type == getGnomeStateAtom()) {
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_STATE"<<endl;
|
||||
#endif
|
||||
FluxboxWindow *win = 0;
|
||||
|
||||
if ((win = searchWindow(ce.window))!=0) {
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): Mask of members to change:"<<
|
||||
hex<<ce.data.l[0]<<dec<<endl; // mask_of_members_to_change
|
||||
cerr<<"New members:"<<ce.data.l[1]<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_STICKY) {
|
||||
cerr<<"Sticky"<<endl;
|
||||
if (!win->isStuck())
|
||||
win->stick();
|
||||
} else if (win->isStuck())
|
||||
win->stick();
|
||||
#endif
|
||||
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_MINIMIZED) {
|
||||
cerr<<"Minimized"<<endl;
|
||||
if (!win->isIconic())
|
||||
win->iconify();
|
||||
} else if (win->isIconic())
|
||||
win->deiconify(true, true);
|
||||
//get new states
|
||||
int flag = ce.data.l[0] & ce.data.l[1];
|
||||
//set states
|
||||
win->setGnomeState(flag);
|
||||
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_MAXIMIZED_VERT)
|
||||
cerr<<"Maximize Vert"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_MAXIMIZED_HORIZ)
|
||||
cerr<<"Maximize Horiz"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_HIDDEN)
|
||||
cerr<<"Hidden"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_SHADED) {
|
||||
cerr<<"Shaded"<<endl;
|
||||
if (!win->isShaded()) win->shade();
|
||||
}
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_HID_WORKSPACE)
|
||||
cerr<<"HID Workspace"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_HID_TRANSIENT)
|
||||
cerr<<"HID Transient"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_FIXED_POSITION)
|
||||
cerr<<"Fixed Position"<<endl;
|
||||
if (ce.data.l[0] & BaseDisplay::WIN_STATE_ARRANGE_IGNORE)
|
||||
cerr<<"Arrange Ignore"<<endl;
|
||||
}
|
||||
} if (ce.message_type == getGnomeHintsAtom()) {
|
||||
} else if (ce.message_type == getGnomeHintsAtom()) {
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_HINTS"<<endl;
|
||||
#endif
|
||||
} else
|
||||
return false; //the gnome atom wasn't found or not supported
|
||||
} else
|
||||
return false; //no gnome atom
|
||||
|
||||
|
@ -1413,7 +1401,7 @@ bool Fluxbox::checkNETWMAtoms(XClientMessageEvent &ce) {
|
|||
Bool Fluxbox::handleSignal(int sig) {
|
||||
switch (sig) {
|
||||
case SIGHUP:
|
||||
reconfigure();
|
||||
load_rc();
|
||||
break;
|
||||
|
||||
case SIGUSR1:
|
||||
|
@ -1429,7 +1417,6 @@ Bool Fluxbox::handleSignal(int sig) {
|
|||
case SIGINT:
|
||||
case SIGTERM:
|
||||
shutdown();
|
||||
|
||||
default:
|
||||
return False;
|
||||
}
|
||||
|
@ -1781,6 +1768,7 @@ void Fluxbox::save_rc(void) {
|
|||
sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number,
|
||||
((screen->getSlit()->doAutoHide()) ? "True" : "False"));
|
||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||
|
||||
#endif // SLIT
|
||||
|
||||
sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
|
||||
|
@ -1854,9 +1842,7 @@ void Fluxbox::save_rc(void) {
|
|||
// write out the users workspace names
|
||||
sprintf(rc_string, "session.screen%d.workspaceNames: ", screen_number);
|
||||
string workspaces_string(rc_string);
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): workspaces="<<screen->getCount()<<endl;
|
||||
#endif
|
||||
|
||||
for (int workspace=0; workspace < screen->getCount(); workspace++) {
|
||||
if (screen->getWorkspace(workspace)->getName()!=0)
|
||||
workspaces_string.append(screen->getWorkspace(workspace)->getName());
|
||||
|
@ -2338,15 +2324,6 @@ void Fluxbox::real_rereadMenu(void) {
|
|||
it.current()->rereadMenu();
|
||||
}
|
||||
|
||||
/*
|
||||
void Fluxbox::saveStyleFilename(const char *filename) {
|
||||
if (resource.style_file)
|
||||
delete [] resource.style_file;
|
||||
|
||||
resource.style_file = StringUtil::strdup(filename);
|
||||
}
|
||||
*/
|
||||
|
||||
void Fluxbox::saveMenuFilename(const char *filename) {
|
||||
Bool found = False;
|
||||
|
||||
|
|
Loading…
Reference in a new issue