aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Window.cc58
1 files changed, 42 insertions, 16 deletions
diff --git a/src/Window.cc b/src/Window.cc
index e97a821..2528a8c 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.295 2004/08/10 19:18:48 fluxgen Exp $ 25// $Id: Window.cc,v 1.296 2004/08/13 12:39:02 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -301,7 +301,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
301 301
302FluxboxWindow::~FluxboxWindow() { 302FluxboxWindow::~FluxboxWindow() {
303#ifdef DEBUG 303#ifdef DEBUG
304 cerr<<__FILE__<<"("<<__LINE__<<"): starting ~FluxboxWindow("<<this<<")"<<endl; 304 cerr<<__FILE__<<"("<<__LINE__<<"): starting ~FluxboxWindow("<<this<<", "<<title()<<")"<<endl;
305 cerr<<__FILE__<<"("<<__LINE__<<"): num clients = "<<numClients()<<endl; 305 cerr<<__FILE__<<"("<<__LINE__<<"): num clients = "<<numClients()<<endl;
306 cerr<<__FILE__<<"("<<__LINE__<<"): curr client = "<<m_client<<endl; 306 cerr<<__FILE__<<"("<<__LINE__<<"): curr client = "<<m_client<<endl;
307 cerr<<__FILE__<<"("<<__LINE__<<"): m_labelbuttons.size = "<<m_labelbuttons.size()<<endl; 307 cerr<<__FILE__<<"("<<__LINE__<<"): m_labelbuttons.size = "<<m_labelbuttons.size()<<endl;
@@ -2031,6 +2031,9 @@ bool FluxboxWindow::isLowerTab() const {
2031void FluxboxWindow::handleEvent(XEvent &event) { 2031void FluxboxWindow::handleEvent(XEvent &event) {
2032 switch (event.type) { 2032 switch (event.type) {
2033 case ConfigureRequest: 2033 case ConfigureRequest:
2034#ifdef DEBUG
2035 cerr<<"ConfigureRequest("<<title()<<")"<<endl;
2036#endif // DEBUG
2034 configureRequestEvent(event.xconfigurerequest); 2037 configureRequestEvent(event.xconfigurerequest);
2035 break; 2038 break;
2036 case MapNotify: 2039 case MapNotify:
@@ -2041,6 +2044,9 @@ void FluxboxWindow::handleEvent(XEvent &event) {
2041 // mapRequestEvent(event.xmaprequest); 2044 // mapRequestEvent(event.xmaprequest);
2042 //break; 2045 //break;
2043 case PropertyNotify: { 2046 case PropertyNotify: {
2047#ifdef DEBUG
2048 cerr<<"PropertyNotify("<<title()<<")"<<endl;
2049#endif // DEBUG
2044 WinClient *client = findClient(event.xproperty.window); 2050 WinClient *client = findClient(event.xproperty.window);
2045 if (client) { 2051 if (client) {
2046 propertyNotifyEvent(*client, event.xproperty.atom); 2052 propertyNotifyEvent(*client, event.xproperty.atom);
@@ -2052,6 +2058,9 @@ void FluxboxWindow::handleEvent(XEvent &event) {
2052#ifdef SHAPE 2058#ifdef SHAPE
2053 if (Fluxbox::instance()->haveShape() && 2059 if (Fluxbox::instance()->haveShape() &&
2054 event.type == Fluxbox::instance()->shapeEventbase() + ShapeNotify) { 2060 event.type == Fluxbox::instance()->shapeEventbase() + ShapeNotify) {
2061#ifdef DEBUG
2062 cerr<<"ShapeNotify("<<title()<<")"<<endl;
2063#endif // DEBUG
2055 XShapeEvent *shape_event = (XShapeEvent *)&event; 2064 XShapeEvent *shape_event = (XShapeEvent *)&event;
2056 2065
2057 if (shape_event->kind != ShapeBounding) 2066 if (shape_event->kind != ShapeBounding)
@@ -2243,13 +2252,29 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2243 break; 2252 break;
2244 2253
2245 case XA_WM_NORMAL_HINTS: { 2254 case XA_WM_NORMAL_HINTS: {
2255#ifdef DEBUG
2256 cerr<<"XA_WM_NORMAL_HINTS("<<title()<<")"<<endl;
2257#endif // DEBUG
2258 int old_max_width = client.max_width;
2259 int old_min_width = client.min_width;
2260 int old_min_height = client.min_height;
2261 int old_max_height = client.max_height;
2262 bool changed = false;
2246 client.updateWMNormalHints(); 2263 client.updateWMNormalHints();
2247 2264
2248 if ((client.normal_hint_flags & PMinSize) && 2265 if ((client.normal_hint_flags & PMinSize) &&
2249 (client.normal_hint_flags & PMaxSize)) { 2266 (client.normal_hint_flags & PMaxSize) &&
2250 2267 (client.min_width != old_min_width ||
2268 client.max_width != old_max_width ||
2269 client.min_height != old_min_height ||
2270 client.max_height != old_max_height)) {
2251 if (client.max_width != 0 && client.max_width <= client.min_width && 2271 if (client.max_width != 0 && client.max_width <= client.min_width &&
2252 client.max_height != 0 && client.max_height <= client.min_height) { 2272 client.max_height != 0 && client.max_height <= client.min_height) {
2273 if (decorations.maximize ||
2274 decorations.handle ||
2275 functions.resize ||
2276 functions.maximize)
2277 changed = true;
2253 decorations.maximize = false; 2278 decorations.maximize = false;
2254 decorations.handle = false; 2279 decorations.handle = false;
2255 functions.resize=false; 2280 functions.resize=false;
@@ -2257,25 +2282,26 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2257 } else { 2282 } else {
2258 // TODO: is broken while handled by FbW, needs to be in WinClient 2283 // TODO: is broken while handled by FbW, needs to be in WinClient
2259 if (! client.isTransient()) { 2284 if (! client.isTransient()) {
2285 if (!decorations.maximize ||
2286 !decorations.handle ||
2287 !functions.maximize)
2288 changed = true;
2260 decorations.maximize = true; 2289 decorations.maximize = true;
2261 decorations.handle = true; 2290 decorations.handle = true;
2262 functions.maximize = true; 2291 functions.maximize = true;
2263 } 2292 }
2293 if (!functions.resize)
2294 changed = true;
2264 functions.resize = true; 2295 functions.resize = true;
2265 } 2296 }
2266 setupWindow();
2267 }
2268 2297
2269 // save old values 2298 if (changed)
2270 int x = frame().x(), y = frame().y(); 2299 setupWindow();
2271 unsigned int w = frame().width(), h = frame().height(); 2300 }
2272 2301
2273 2302 moveResize(frame().x(), frame().y(),
2274 // reconfigure if the old values changed 2303 frame().width(), frame().height());
2275 if (x != frame().x() || y != frame().y() || 2304
2276 w != frame().width() || h != frame().height()) {
2277 moveResize(x, y, w, h);
2278 }
2279 2305
2280 break; 2306 break;
2281 } 2307 }
@@ -2309,6 +2335,7 @@ void FluxboxWindow::exposeEvent(XExposeEvent &ee) {
2309} 2335}
2310 2336
2311void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { 2337void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2338
2312 WinClient *client = findClient(cr.window); 2339 WinClient *client = findClient(cr.window);
2313 if (client == 0) 2340 if (client == 0)
2314 return; 2341 return;
@@ -2345,7 +2372,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2345 frame().moveResizeForClient(cx, cy, cw, ch); 2372 frame().moveResizeForClient(cx, cy, cw, ch);
2346 else 2373 else
2347 frame().resizeForClient(cw, ch); 2374 frame().resizeForClient(cw, ch);
2348
2349 } else if (frame().x() != cx || frame().y() != cy) { 2375 } else if (frame().x() != cx || frame().y() != cy) {
2350 frame().move(cx, cy); 2376 frame().move(cx, cy);
2351 } 2377 }