#endif // HAVE_STDARG_H
}
+#include <assert.h>
+
#include <algorithm>
#include <functional>
+#include <string>
using std::string;
#include "i18n.hh"
}
+void BScreen::saveWindowToWindowSnap(bool s) {
+ resource.window_to_window_snap = s;
+ config->setValue(screenstr + "windowToWindowSnap",
+ resource.window_to_window_snap);
+}
+
+
+void BScreen::saveWindowCornerSnap(bool s) {
+ resource.window_corner_snap = s;
+ config->setValue(screenstr + "windowCornerSnap",
+ resource.window_corner_snap);
+}
+
+
void BScreen::saveWorkspaces(unsigned int w) {
resource.workspaces = w;
config->setValue(screenstr + "workspaces", resource.workspaces);
saveFocusNew(resource.focus_new);
saveFocusLast(resource.focus_last);
saveHideToolbar(resource.hide_toolbar);
+ saveWindowToWindowSnap(resource.window_to_window_snap);
+ saveWindowCornerSnap(resource.window_corner_snap);
saveWorkspaces(resource.workspaces);
savePlacementPolicy(resource.placement_policy);
saveEdgeSnapThreshold(resource.edge_snap_threshold);
if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
resource.hide_toolbar = false;
+ if (! config->getValue(screenstr + "windowToWindowSnap",
+ resource.window_to_window_snap))
+ resource.window_to_window_snap = true;
+
+ if (! config->getValue(screenstr + "windowCornerSnap",
+ resource.window_corner_snap))
+ resource.window_corner_snap = true;
+
if (! config->getValue(screenstr + "imageDither", b))
b = true;
image_control->setDither(b);
workspacemenu->setItemSelected(current_workspace->getID() + 2, False);
- if (blackbox->getFocusedWindow() &&
- blackbox->getFocusedWindow()->getScreen() == this &&
- (! blackbox->getFocusedWindow()->isStuck())) {
- current_workspace->setLastFocusedWindow(blackbox->getFocusedWindow());
+ BlackboxWindow *focused = blackbox->getFocusedWindow();
+ if (focused && focused->getScreen() == this && ! focused->isStuck()) {
+ if (focused->getWorkspaceNumber() != current_workspace->getID()) {
+ fprintf(stderr, "%s is on the wrong workspace, aborting\n",
+ focused->getTitle());
+ abort();
+ }
+ current_workspace->setLastFocusedWindow(focused);
blackbox->setFocusedWindow((BlackboxWindow *) 0);
}
XMapRequestEvent mre;
mre.window = w;
- win->restoreAttributes();
+ if (blackbox->isStartup()) win->restoreAttributes();
win->mapRequestEvent(&mre);
}