diff options
author | Travis Watkins <travis.watkins@linaro.org> | 2011-08-30 08:33:54 -0500 |
---|---|---|
committer | Travis Watkins <travis.watkins@linaro.org> | 2011-08-30 08:33:54 -0500 |
commit | 43c84a48550f71455582915c4881241a5e360ec2 (patch) | |
tree | 7c0c9cc0c281973694e61118d17840050c5a48b5 | |
parent | 9fd0b94c600a451726e4b2124516afe3d32f13bc (diff) | |
parent | 5fbc293d6c63eb3e74f00ffa791b4f4abd3e10c2 (diff) | |
download | mobileperf-43c84a48550f71455582915c4881241a5e360ec2.tar.gz mobileperf-43c84a48550f71455582915c4881241a5e360ec2.tar.bz2 |
Merge branch 'master' into gles
Conflicts:
src/plugin.cpp
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | ChangeLog | 251 | ||||
-rw-r--r-- | NEWS | 15 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | cmake/CompizGSettings.cmake | 15 | ||||
-rw-r--r-- | cmake/plugin_extensions/CompizGenGSettings.cmake | 13 | ||||
-rw-r--r-- | metadata/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/resize/src/resize.cpp | 3 | ||||
-rw-r--r-- | src/eventsource.cpp | 6 | ||||
-rw-r--r-- | src/plugin.cpp | 7 | ||||
-rw-r--r-- | src/privateeventsource.h | 5 | ||||
-rw-r--r-- | src/privatescreen.h | 4 | ||||
-rw-r--r-- | src/privatewindow.h | 19 | ||||
-rw-r--r-- | src/screen.cpp | 6 | ||||
-rw-r--r-- | src/window.cpp | 155 |
15 files changed, 407 insertions, 100 deletions
@@ -1,6 +1,7 @@ Adam Williamson <awilliam@redhat.com> Adel Gadllah <adel.gadllah@gmail.com> Alyssa Hung <deciare@isisview.org> +Andrea Azzarone <azzaronea@gmail.com> Bellegarde Cedric <gnumdk@gmail.com> Bellegarde Cedric <gnumdk@puffy.homelinux.org> C-F Language team <i18n@opencompositing.org> @@ -85,9 +86,12 @@ Steven Robertson <nihilismwow@gmail.com> Stjepan Glavina <stjepang@gmail.com> Søren Sandmann <sandmann@redhat.com> Thierry Reding <thierry@gilfi.de> +Tim Penhey <tim.penhey@canonical.com> +Time Penhey <tim.penhey@canonical.com> Tomas Carnecky <tom@dbservice.com> Travis Watkins <amaranth@ubuntu.com> Unity <unity@VB-U1010.(none)> +Ville Syrjala <syrjala@sci.fi> Zack Rusin <zack@kde.org> dragoran <drago01@gmail.com> gandalfn <gandalfn@club-internet.fr> @@ -1,3 +1,250 @@ +Merge: 86bbd39 a7f5dbb +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Merge upstream + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Bump VERSION to reflect temporary release + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Fix stray .reset () + +Merge: 1be316e 126f2a2 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Merge upstream + +Merge: 1852f86 1852f86 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Merge upstream + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Bump VERSION + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-20 + + Update NEWS for 0.9.5.92 + +Merge: 8495379 825d16b +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge upstream + +Merge: 825d16b c9b0a19 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge in lp:~compiz-team/compiz-core/compiz-core.add_doc_for_decor + +Merge: 41f088c c12c848 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge lp:~compiz-team/compiz-core/compiz-core.distortion_fixes + +Merge: b0a1b5e 3504586 +Tim Penhey <tim.penhey@canonical.com> 2011-08-19 + + Merge lp:~thumper/compiz-core/fix-crash-on-event-source-cleanup + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Fix some other places we were using priv->attrib incorrectly + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Added comment explaining why we can't do that + +Merge: 01d92ab b0a1b5e +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge trunk + +Tim Penhey <tim.penhey@canonical.com> 2011-08-19 + + Don't have a wrapped CompEventSource as there is a bug in the destruction code. + +Tim Penhey <tim.penhey@canonical.com> 2011-08-19 + + Explicit constructors only make a difference when there is the ability to pass in a single argument. + +Tim Penhey <tim.penhey@canonical.com> 2011-08-19 + + Header now says to create an unwrapped event source. + +Tim Penhey <tim.penhey@canonical.com> 2011-08-19 + + Create an unwrapped CompEventSource. + +Merge: ab71bc8 9f4cdd6 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge + +Merge: 9f4cdd6 a8d1bcd +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-19 + + Merge in ICCCM 4.1.4 support + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-18 + + Correctly support ICCCM Section 4.1.4 + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-13 + + Don't damage the paint rectangle in normal resize mode (fixed valgrind warning) + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-13 + + Use priv->geometry rather than priv->attrib, since priv->attrib could be updated by XGetWindowAttributes + which is a synchronous operation + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-13 + + Don't check against the XWindowAttributes that are stored when sending resize + notfications, since they could have been updated synchronously with XGetWindowAttributes + and could be out of sync with the geometry last received from the server which is what + we need to process requests based on. + + Fixes cases where plugins didn't get that geometry update because of this condition, + which caused bugs like distorted windows in opengl since the window matrices were + wrong + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-12 + + memset the active window history so that we aren't jumping on unitialized garbage + in the array of windows + +Time Penhey <tim.penhey@canonical.com> 2011-08-12 + + Merge in flags change for dlopen () on debug builds (dlclosing () with valgrind + is a bit useless) + +Time Penhey <tim.penhey@canonical.com> 2011-08-12 + + Merge in source reset change + +Merge: 28cab1d e6cb461 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-12 + + Merge in GSettings CMake file change + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-10 + + Disable core-settings-schema too + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-08-10 + + Add option to disable GSettings schema generation + +Ville Syrjala <syrjala@sci.fi> 2011-08-02 + + [PATCH] Don't unredirect overlay windows until we have set the new + bounding shape for the output window. + + Unredirecting them before this time meant that they were stacked + underneath the overlay window and changing the bounding shape of + the output window would cause an expose event to be sent to + the overlay window causing a breif flicker as it redraws. + + Unredirecting after this means that no expose event is sent because + the backing store is only set again after the bounding shape of the + output window has been changed + +Merge: ceab806 f2b2dc4 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-29 + + Merge trunk + +Merge: f2b2dc4 c9b0a19 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-29 + + Merge in doc for decor + +Merge: 7347a7c 3bdb2ef +Andrea Azzarone <azzaronea@gmail.com> 2011-07-28 + + Merge in lp:~andyrock/compiz-core/fix-1309 + +Andrea Azzarone <azzaronea@gmail.com> 2011-07-27 + + If an argument to a strcmp function has an invalid value (null pointer, etc.) the behavior is undefined. + +Merge: 3264985 4217940 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-27 + + Merge + +Merge: a44844f 4bb1f70 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-27 + + Merge in gsettings schema generation + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-26 + + Use relocatable keys + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-26 + + Merge in gsettings schema generation + +Scott Moreau <oreaus@gmail.com> 2011-07-14 + + Merge in default value change for obs + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Fix typo, also add files that are being copied into staging + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Bump VERSION + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Update NEWS for 0.9.5.0 + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Revert "Update NEWS for 0.9.5.0" + + This reverts commit a6e2ea3adf61e57bdcd4c5c957ce8e7223a9fb0b. + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Revert "Bump VERSION" + + This reverts commit bedeff5d74a2786dd2751fab9e48bf3f96b7790e. + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Revert "Update NEWS for 0.9.5.0" + + This reverts commit f37eda58232743ce28eb780075c1a4b73545a209. + +Merge: 2804807 bedeff5 +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Merge branch 'master' of git+ssh://git.compiz.org/git/compiz/core + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Bump VERSION + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Update NEWS for 0.9.5.0 + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Bump VERSION + +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 + + Update NEWS for 0.9.5.0 + Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-14 Merge in build fix and debug message removal @@ -204,6 +451,10 @@ Sam Spilsbury <sam.spilsbury@canonical.com> 2011-06-23 and unmapped windows or other docks when shuffling stacking to be below fullscreen windows that are active +Sam Spilsbury <sam.spilsbury@canonical.com> 2011-06-18 + + Add documentation for the decor plugin + Merge: 291627c 40849c0 Sam Spilsbury <sam.spilsbury@canonical.com> 2011-06-18 @@ -1,13 +1,6 @@ -Release 0.9.5.0 ( 2011-07-14 Sam Spilsbury <sam.spilsbury@canonical.com> ) -=========================================================================== -Development Release (0.9.5.0) +Release 0.9.5.92.1 ( 2011-08-20 Sam Spilsbury <sam.spilsbury@canonical.com> ) +============================================================================== +Release (0.9.5.92.1) -Added new CMake commands to simplify releases - -Added unit tests - -Fixed a number of reparenting and stacking bugs - -Changed decoration interface. Now decorators can specify multiple decorations -for a single window allowing compiz to cache decorations as needed +Fix failure to build from source due to merge failure on the last release @@ -1 +1 @@ -0.9.5.2 +0.9.5.94 diff --git a/cmake/CompizGSettings.cmake b/cmake/CompizGSettings.cmake index 5af71e3..192764d 100644 --- a/cmake/CompizGSettings.cmake +++ b/cmake/CompizGSettings.cmake @@ -1,6 +1,12 @@ option ( + USE_GSETTINGS + "Generate GSettings schemas" + ON +) + +option ( COMPIZ_DISABLE_GS_SCHEMAS_INSTALL - "Disables gsettings schema installation with gconftool" + "Disables gsettings schema installation" OFF ) @@ -18,7 +24,10 @@ function (compiz_install_gsettings_schema _src _dst) execute_process (COMMAND ${PKG_CONFIG_TOOL} glib-2.0 --variable prefix OUTPUT_VARIABLE GSETTINGS_GLIB_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) SET (GSETTINGS_GLOBAL_INSTALL_DIR "${GSETTINGS_GLIB_PREFIX}/share/glib-2.0/schemas/") - if (PKG_CONFIG_TOOL AND GLIB_COMPILE_SCHEMAS AND NOT COMPIZ_DISABLE_SCHEMAS_INSTALL) + if (PKG_CONFIG_TOOL AND + GLIB_COMPILE_SCHEMAS AND NOT + COMPIZ_DISABLE_SCHEMAS_INSTALL AND + USE_GSETTINGS) install (CODE " message (\"$ENV{USER} is the username in use right now\") if (\"$ENV{USER}\"\ STREQUAL \"root\") @@ -52,7 +61,7 @@ function (compiz_gsettings_schema _src _dst _inst) find_program (XSLTPROC_EXECUTABLE xsltproc) mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) - if (XSLTPROC_EXECUTABLE) + if (XSLTPROC_EXECUTABLE AND USE_GSETTINGS) message ("generating gsettings schema for core") add_custom_command ( OUTPUT ${_dst} diff --git a/cmake/plugin_extensions/CompizGenGSettings.cmake b/cmake/plugin_extensions/CompizGenGSettings.cmake index 49e6807..b182d13 100644 --- a/cmake/plugin_extensions/CompizGenGSettings.cmake +++ b/cmake/plugin_extensions/CompizGenGSettings.cmake @@ -4,6 +4,12 @@ option ( OFF ) +option ( + USE_GSETTINGS + "Generate GSettings schemas" + ON +) + set ( COMPIZ_INSTALL_GSETTINGS_SCHEMA_DIR ${COMPIZ_INSTALL_GSETTINGS_SCHEMA_DIR} CACHE PATH "Installation path of the gsettings schema file" @@ -47,7 +53,10 @@ function (compiz_install_gsettings_schema _src _dst) execute_process (COMMAND ${PKG_CONFIG_TOOL} glib-2.0 --variable prefix OUTPUT_VARIABLE GSETTINGS_GLIB_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) SET (GSETTINGS_GLOBAL_INSTALL_DIR "${GSETTINGS_GLIB_PREFIX}/share/glib-2.0/schemas/") - if (PKG_CONFIG_TOOL AND GLIB_COMPILE_SCHEMAS AND NOT COMPIZ_DISABLE_SCHEMAS_INSTALL) + if (USE_GSETTINGS AND + PKG_CONFIG_TOOL AND + GLIB_COMPILE_SCHEMAS AND NOT + COMPIZ_DISABLE_SCHEMAS_INSTALL) install (CODE " if (\"$ENV{USER}\"\ STREQUAL \"root\") message (\"-- Installing GSettings schemas ${GSETTINGS_GLOBAL_INSTALL_DIR}\"\) @@ -79,7 +88,7 @@ endfunction () find_program (XSLTPROC_EXECUTABLE xsltproc) mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) -if (XSLTPROC_EXECUTABLE) +if (XSLTPROC_EXECUTABLE AND USE_GSETTINGS) compiz_gsettings_prepare_install_dirs () add_custom_command ( diff --git a/metadata/CMakeLists.txt b/metadata/CMakeLists.txt index cd93a70..77e2be9 100644 --- a/metadata/CMakeLists.txt +++ b/metadata/CMakeLists.txt @@ -49,6 +49,8 @@ if (USE_GCONF) add_custom_target (core-gconf-schema ALL DEPENDS ${CMAKE_BINARY_DIR}/generated/compiz-core.schemas ) +endif () +if (USE_GSETTINGS) compiz_gsettings_schema ( ${CMAKE_BINARY_DIR}/generated/core.xml ${CMAKE_BINARY_DIR}/generated/org.freedesktop.compiz.gschema.xml diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp index a487d90..84cee80 100644 --- a/plugins/resize/src/resize.cpp +++ b/plugins/resize/src/resize.cpp @@ -894,7 +894,8 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot) cwi = wi; che = he; - if (w->constrainNewWindowSize (wi, he, &cwi, &che)) + if (w->constrainNewWindowSize (wi, he, &cwi, &che) && + mode != ResizeOptions::ModeNormal) { Box box; diff --git a/src/eventsource.cpp b/src/eventsource.cpp index 2973d17..cb35773 100644 --- a/src/eventsource.cpp +++ b/src/eventsource.cpp @@ -26,10 +26,12 @@ #include "privatescreen.h" -Glib::RefPtr <CompEventSource> +//Glib::RefPtr <CompEventSource> +CompEventSource* CompEventSource::create () { - return Glib::RefPtr <CompEventSource> (new CompEventSource ()); + // return Glib::RefPtr <CompEventSource> (new CompEventSource ()); + return new CompEventSource (); } sigc::connection diff --git a/src/plugin.cpp b/src/plugin.cpp index 2dabcbd..16dfa7d 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -154,7 +154,12 @@ dlloaderLoadPlugin (CompPlugin *p, return false; } - dlhand = dlopen (file.c_str (), RTLD_LAZY | RTLD_GLOBAL); + int open_flags = RTLD_LAZY | RTLD_GLOBAL; +#ifdef DEBUG + // Do not unload the library during dlclose. + open_flags |= RTLD_NODELETE; +#endif + dlhand = dlopen (file.c_str (), open_flags); if (dlhand) { PluginGetInfoProc getInfo; diff --git a/src/privateeventsource.h b/src/privateeventsource.h index 92eda18..d629582 100644 --- a/src/privateeventsource.h +++ b/src/privateeventsource.h @@ -32,7 +32,8 @@ class CompEventSource: public: static - Glib::RefPtr <CompEventSource> create (); + // Glib::RefPtr <CompEventSource> create (); + CompEventSource* create (); sigc::connection connect (const sigc::slot <bool> &slot); @@ -43,7 +44,7 @@ class CompEventSource: bool dispatch (sigc::slot_base *slot); bool callback (); - explicit CompEventSource (); + CompEventSource (); virtual ~CompEventSource (); private: diff --git a/src/privatescreen.h b/src/privatescreen.h index b6cd6b6..e0798c3 100644 --- a/src/privatescreen.h +++ b/src/privatescreen.h @@ -302,7 +302,9 @@ class PrivateScreen : PrivateScreen *priv; Glib::RefPtr <Glib::MainLoop> mainloop; - Glib::RefPtr <CompEventSource> source; + // See https://bugzilla.gnome.org/show_bug.cgi?id=561885 + // Glib::RefPtr <CompEventSource> source; + CompEventSource* source; Glib::RefPtr <CompTimeoutSource> timeout; Glib::RefPtr <Glib::MainContext> ctx; diff --git a/src/privatewindow.h b/src/privatewindow.h index d1cf73c..a20a01c 100644 --- a/src/privatewindow.h +++ b/src/privatewindow.h @@ -36,10 +36,14 @@ #define WINDOW_INVISIBLE(w) \ ((w)->attrib.map_state != IsViewable || \ - (w)->attrib.x + (w)->width + (w)->output.right <= 0 || \ - (w)->attrib.y + (w)->height + (w)->output.bottom <= 0 || \ - (w)->attrib.x - (w)->output.left >= (int) screen->width () || \ - (w)->attrib.y - (w)->output.top >= (int) screen->height () ) + (w)->geometry.x () + (w)->geometry.width () + \ + (w)->geometry.border () * 2 + (w)->output.right <= 0 || \ + (w)->geometry.y () + (w)->geometry.height () + \ + (w)->geometry.border () * 2 + (w)->output.bottom <= 0 || \ + (w)->geometry.x () - \ + (w)->output.left >= (int) screen->width () || \ + (w)->geometry.y () - \ + (w)->output.top >= (int) screen->height () ) typedef CompWindowExtents CompFullscreenMonitorSet; @@ -223,6 +227,13 @@ class PrivateWindow { Window wrapper; unsigned int mapNum; unsigned int activeNum; + + /* Don't use this for determining + * the window geometry because we + * read into this out of sync with + * ConfigureNotify events to determine + * the class and override redirect state + */ XWindowAttributes attrib; CompWindow::Geometry geometry; CompWindow::Geometry serverGeometry; diff --git a/src/screen.cpp b/src/screen.cpp index 2ab2b02..a0b284d 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -2036,9 +2036,9 @@ PrivateScreen::configure (XConfigureEvent *ce) priv->attrib.height = ce->height; } - priv->reshape (ce->width, ce->height); + priv->reshape (ce->width, ce->height); - priv->detectOutputDevices (); + priv->detectOutputDevices (); } void @@ -4663,6 +4663,8 @@ PrivateScreen::PrivateScreen (CompScreen *screen) : boost::bind (&PrivateScreen::handleStartupSequenceTimeout, this)); startupSequenceTimer.setTimes (1000, 1500); + memset (&history, 0, sizeof (Window) * ACTIVE_WINDOW_HISTORY_NUM); + optionSetCloseWindowKeyInitiate (CompScreen::closeWin); optionSetCloseWindowButtonInitiate (CompScreen::closeWin); optionSetRaiseWindowKeyInitiate (CompScreen::raiseWin); diff --git a/src/window.cpp b/src/window.cpp index f30f28a..d182727 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -796,11 +796,11 @@ PrivateWindow::updateFrameWindow () xev.event = screen->root (); xev.window = priv->frame; - xev.x = x; - xev.y = y; - xev.width = width; - xev.height = height; - xev.border_width = window->priv->attrib.border_width; + xev.x = serverGeometry.x (); + xev.y = serverGeometry.y (); + xev.width = serverGeometry.width (); + xev.height = serverGeometry.height (); + xev.border_width = serverGeometry.border (); xev.above = (window->prev) ? ROOTPARENT (window->prev) : None; xev.override_redirect = window->priv->attrib.override_redirect; @@ -901,8 +901,8 @@ PrivateWindow::rectsToRegion (unsigned int n, XRectangle *rects) for (unsigned int i = 0; i < n; i++) { - x1 = rects[i].x + priv->attrib.border_width; - y1 = rects[i].y + priv->attrib.border_width; + x1 = rects[i].x + priv->geometry.border (); + y1 = rects[i].y + priv->geometry.border (); x2 = x1 + rects[i].width; y2 = y1 + rects[i].height; @@ -917,10 +917,10 @@ PrivateWindow::rectsToRegion (unsigned int n, XRectangle *rects) if (y1 < y2 && x1 < x2) { - x1 += priv->attrib.x; - y1 += priv->attrib.y; - x2 += priv->attrib.x; - y2 += priv->attrib.y; + x1 += priv->geometry.x (); + y1 += priv->geometry.y (); + x2 += priv->geometry.x (); + y2 += priv->geometry.y (); ret += CompRect (x1, y1, x2 - x1, y2 - y1); } @@ -955,6 +955,7 @@ PrivateWindow::updateRegion () } + /* FIXME: That doesn't look right */ r.x = -priv->attrib.border_width; r.y = -priv->attrib.border_width; r.width = priv->width + priv->attrib.border_width; @@ -1229,10 +1230,10 @@ CompWindow::sendConfigureNotify () xev.window = priv->id; /* normally we should never send configure notify events to override - redirect windows but if they support the _NET_WM_SYNC_REQUEST - protocol we need to do this when the window is mapped. however the - only way we can make sure that the attributes we send are correct - and is to grab the server. */ + * redirect windows but if they support the _NET_WM_SYNC_REQUEST + * protocol we need to do this when the window is mapped. however the + * only way we can make sure that the attributes we send are correct + * and is to grab the server. */ if (priv->attrib.override_redirect) { XWindowAttributes attrib; @@ -1320,8 +1321,11 @@ CompWindow::map () { /* been shaded */ if (!priv->height) - resize (priv->attrib.x, priv->attrib.y, priv->attrib.width, - ++priv->attrib.height - 1, priv->attrib.border_width); + { + priv->geometry.setHeight (priv->geometry.height () + 1); + resize (priv->geometry.x (), priv->geometry.y (), priv->geometry.width (), + priv->geometry.height () - 1, priv->geometry.border ()); + } } } @@ -1394,9 +1398,9 @@ CompWindow::unmap () priv->invisible = true; if (priv->shaded && priv->height) - resize (priv->attrib.x, priv->attrib.y, - priv->attrib.width, ++priv->attrib.height - 1, - priv->attrib.border_width); + resize (priv->geometry.x (), priv->geometry.y (), + priv->geometry.width (), priv->geometry.height () - 1, + priv->geometry.border ()); screen->priv->updateClientList (); @@ -1475,20 +1479,14 @@ CompWindow::resize (CompWindow::Geometry gm) if (priv->shaded) ph = 0; - dx = gm.x () - priv->attrib.x; - dy = gm.y () - priv->attrib.y; - dwidth = gm.width () - priv->attrib.width; - dheight = gm.height () - priv->attrib.height; - - priv->attrib.x = gm.x (); - priv->attrib.y = gm.y (); - priv->attrib.width = gm.width (); - priv->attrib.height = gm.height (); - priv->attrib.border_width = gm.border (); + dx = gm.x () - priv->geometry.x (); + dy = gm.y () - priv->geometry.y (); + dwidth = gm.width () - priv->geometry.width (); + dheight = gm.height () - priv->geometry.height (); - priv->geometry.set (priv->attrib.x, priv->attrib.y, - priv->attrib.width, priv->attrib.height, - priv->attrib.border_width); + priv->geometry.set (gm.x (), gm.y (), + gm.width (), gm.height (), + gm.border ()); priv->width = pw; priv->height = ph; @@ -1505,8 +1503,8 @@ CompWindow::resize (CompWindow::Geometry gm) { int dx, dy; - dx = gm.x () - priv->attrib.x; - dy = gm.y () - priv->attrib.y; + dx = gm.x () - priv->geometry.x (); + dy = gm.y () - priv->geometry.y (); move (dx, dy); } @@ -1715,11 +1713,8 @@ CompWindow::move (int dx, { if (dx || dy) { - priv->attrib.x += dx; - priv->attrib.y += dy; - - priv->geometry.setX (priv->attrib.x); - priv->geometry.setY (priv->attrib.y); + priv->geometry.setX (priv->geometry.x () + dx); + priv->geometry.setY (priv->geometry.y () + dy); priv->region.translate (dx, dy); priv->inputRegion.translate (dx, dy); @@ -1735,12 +1730,12 @@ CompWindow::move (int dx, void CompWindow::syncPosition () { - priv->serverGeometry.setX (priv->attrib.x); - priv->serverGeometry.setY (priv->attrib.y); + priv->serverGeometry.setX (priv->geometry.x ()); + priv->serverGeometry.setY (priv->geometry.y ()); XMoveWindow (screen->dpy (), ROOTPARENT (this), - priv->attrib.x - priv->input.left, - priv->attrib.y - priv->input.top); + priv->geometry.x () - priv->input.left, + priv->geometry.y () - priv->input.top); if (priv->frame) { @@ -1770,10 +1765,10 @@ CompWindow::focus () if (!priv->shaded && (priv->state & CompWindowStateHiddenMask)) return false; - if (priv->attrib.x + priv->width <= 0 || - priv->attrib.y + priv->height <= 0 || - priv->attrib.x >= (int) screen->width ()|| - priv->attrib.y >= (int) screen->height ()) + if (priv->geometry.x () + priv->width <= 0 || + priv->geometry.y () + priv->height <= 0 || + priv->geometry.x () >= (int) screen->width ()|| + priv->geometry.y () >= (int) screen->height ()) return false; return true; @@ -3851,9 +3846,12 @@ PrivateWindow::show () XMapWindow (screen->dpy (), frame); if (height) - window->resize (attrib.x, attrib.y, - attrib.width, ++attrib.height - 1, - attrib.border_width); + { + priv->geometry.setHeight (priv->geometry.height () + 1); + window->resize (geometry.x (), geometry.y (), + geometry.width (), geometry.height () - 1, + geometry.border ()); + } return; } @@ -4509,7 +4507,7 @@ CompWindow::getMovementForOffset (CompPoint offset) } else { - m = priv->attrib.x + offX; + m = priv->geometry.x () + offX; if (m - priv->input.left < (int) s->width () - vWidth) rv.setX (offX + vWidth); else if (m + priv->width + priv->input.right > vWidth) @@ -4524,7 +4522,7 @@ CompWindow::getMovementForOffset (CompPoint offset) } else { - m = priv->attrib.y + offY; + m = priv->geometry.y () + offY; if (m - priv->input.top < (int) s->height () - vHeight) rv.setY (offY + vHeight); else if (m + priv->height + priv->input.bottom > vHeight) @@ -4756,6 +4754,7 @@ void PrivateWindow::processMap () { bool allowFocus; + bool initiallyMinimized; CompStackingUpdateMode stackingMode; priv->initialViewport = screen->vp (); @@ -4798,6 +4797,9 @@ PrivateWindow::processMap () priv->placed = true; } + initiallyMinimized = (priv->hints && + priv->hints->initial_state == IconicState && + !window->minimized ()); allowFocus = allowWindowFocus (NO_FOCUS_MASK, 0); if (!allowFocus && (priv->type & ~NO_FOCUS_MASK)) @@ -4807,9 +4809,27 @@ PrivateWindow::processMap () window->updateAttributes (stackingMode); - if (window->minimized ()) + if (window->minimized () && !initiallyMinimized) window->unminimize (); + if (!initiallyMinimized) + { + if (allowFocus && !window->onCurrentDesktop ()); + screen->priv->setCurrentDesktop (priv->desktop); + + if (!(priv->state & CompWindowStateHiddenMask)) + show (); + + if (allowFocus) + window->moveInputFocusTo (); + } + else + { + window->minimize (); + window->changeState (window->state () | CompWindowStateHiddenMask); + screen->priv->updateClientList (); + } + screen->leaveShowDesktopMode (window); if (allowFocus && !window->onCurrentDesktop ()) @@ -5047,8 +5067,8 @@ CompWindow::moveToViewportPosition (int x, y -= screen->vp ().y () * screen->height (); } - tx = x - priv->attrib.x; - ty = y - priv->attrib.y; + tx = x - priv->geometry.x (); + ty = y - priv->geometry.y (); if (tx || ty) { @@ -5068,7 +5088,7 @@ CompWindow::moveToViewportPosition (int x, if (screen->vpSize ().width ()!= 1) { - m = priv->attrib.x + tx; + m = priv->geometry.x () + tx; if (m - priv->output.left < (int) screen->width () - vWidth) wx = tx + vWidth; @@ -5078,7 +5098,7 @@ CompWindow::moveToViewportPosition (int x, if (screen->vpSize ().height () != 1) { - m = priv->attrib.y + ty; + m = priv->geometry.y () + ty; if (m - priv->output.top < (int) screen->height () - vHeight) wy = ty + vHeight; @@ -5327,7 +5347,7 @@ CompWindow::CompWindow (Window aboveId, if (priv->attrib.c_class != InputOnly) { - priv->region = CompRegion (priv->attrib.x, priv->attrib.y, + priv->region = CompRegion (priv->geometry.x (), priv->geometry.y (), priv->width, priv->height); priv->inputRegion = priv->region; @@ -5459,9 +5479,12 @@ CompWindow::CompWindow (Window aboveId, priv->updateIconGeometry (); if (priv->shaded) - resize (priv->attrib.x, priv->attrib.y, - priv->attrib.width, ++priv->attrib.height - 1, - priv->attrib.border_width); + { + priv->geometry.setHeight (priv->geometry.height () + 1); + resize (priv->geometry.x (), priv->geometry.y (), + priv->geometry.width (), priv->geometry.height () - 1, + priv->geometry.border ()); + } if (priv->attrib.map_state == IsViewable) { @@ -5857,14 +5880,6 @@ PrivateWindow::reparent () return false; } - /* Since we have read directly to our XWindowAttributes - * we need to update the size of a window since it might - * have changed during the reparent - */ - - window->resize (attrib.x, attrib.y, attrib.width, attrib.height, - attrib.border_width); - if (attrib.override_redirect) return false; |