summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-02-04 23:59:42 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-02-04 23:59:42 +0800
commit08c22af5823771444b8c189c265a526ccb998068 (patch)
tree5b6744671d7cf7f702c7f59bd166947f78d923f5 /src
parent1ac4afe31360d2d8255208372148f403136f5499 (diff)
downloadzcomp-08c22af5823771444b8c189c265a526ccb998068.tar.gz
zcomp-08c22af5823771444b8c189c265a526ccb998068.tar.bz2
place: Improve resolution change handling.
Windows are now moved/resized in a better way when changing resolution. Also, old window position and size will be remembered, so that they can be restored when going back to the original resolution. API changes were necessary in core, the functions ::updateStruts and ::updateWorkarea were moved from Private* to Comp* Forward port of 4327a7c83dc6c1fe77891ba7c6bf5023d21dfde8
Diffstat (limited to 'src')
-rw-r--r--src/event.cpp4
-rw-r--r--src/privatescreen.h2
-rw-r--r--src/privatewindow.h2
-rw-r--r--src/screen.cpp4
-rw-r--r--src/window.cpp10
5 files changed, 9 insertions, 13 deletions
diff --git a/src/event.cpp b/src/event.cpp
index f1d7c7b..6161c1c 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1227,8 +1227,8 @@ CompScreen::handleEvent (XEvent *event)
w = findWindow (event->xproperty.window);
if (w)
{
- if (w->priv->updateStruts ())
- priv->updateWorkarea ();
+ if (w->updateStruts ())
+ updateWorkarea ();
}
}
else if (event->xproperty.atom == Atoms::mwmHints)
diff --git a/src/privatescreen.h b/src/privatescreen.h
index a5d73bb..0f77294 100644
--- a/src/privatescreen.h
+++ b/src/privatescreen.h
@@ -262,8 +262,6 @@ class PrivateScreen : public CoreOptions {
void eraseWindowFromMap (Window id);
- void updateWorkarea ();
-
void updateClientList ();
CompGroup * addGroup (Window id);
diff --git a/src/privatewindow.h b/src/privatewindow.h
index b319579..5ee2864 100644
--- a/src/privatewindow.h
+++ b/src/privatewindow.h
@@ -159,8 +159,6 @@ class PrivateWindow {
void updateRegion ();
- bool updateStruts ();
-
bool handleSyncAlarm ();
void configure (XConfigureEvent *ce);
diff --git a/src/screen.cpp b/src/screen.cpp
index 794abb4..5429e71 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -1848,7 +1848,7 @@ PrivateScreen::updateOutputDevices ()
if (outputDevs[i].intersects (outputDevs[j]))
hasOverlappingOutputs = true;
- updateWorkarea ();
+ screen->updateWorkarea ();
screen->outputChangeNotify ();
}
@@ -3107,7 +3107,7 @@ PrivateScreen::computeWorkareaForBox (const CompRect& box)
}
void
-PrivateScreen::updateWorkarea ()
+CompScreen::updateWorkarea ()
{
CompRect workArea;
bool workAreaChanged = false;
diff --git a/src/window.cpp b/src/window.cpp
index 24d98fd..f1d8f82 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -909,7 +909,7 @@ PrivateWindow::updateRegion ()
}
bool
-PrivateWindow::updateStruts ()
+CompWindow::updateStruts ()
{
Atom actual;
int result, format;
@@ -1237,7 +1237,7 @@ CompWindow::map ()
priv->mapNum = screen->priv->mapNum++;
if (priv->struts)
- screen->priv->updateWorkarea ();
+ screen->updateWorkarea ();
if (windowClass () == InputOnly)
return;
@@ -1298,7 +1298,7 @@ CompWindow::unmap ()
return;
if (priv->struts)
- screen->priv->updateWorkarea ();
+ screen->updateWorkarea ();
if (priv->attrib.map_state != IsViewable)
return;
@@ -4917,7 +4917,7 @@ CompWindow::CompWindow (Window id,
if (!overrideRedirect ())
{
priv->updateNormalHints ();
- priv->updateStruts ();
+ updateStruts ();
priv->updateWmHints ();
priv->updateTransientHint ();
@@ -5069,7 +5069,7 @@ CompWindow::~CompWindow ()
screen->priv->desktopWindowCount--;
if (priv->destroyed && priv->struts)
- screen->priv->updateWorkarea ();
+ screen->updateWorkarea ();
}
if (priv->destroyed)