summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-10-28 02:17:03 (GMT)
committerrathnor <rathnor>2003-10-28 02:17:03 (GMT)
commitf5f979ef374623fffc321300ec7f699acd20e426 (patch)
tree71badb4166aeeecda67a94849940e009a02e045c /src
parent6b9b0e89e4549787077ccbdef67893443c76dc75 (diff)
downloadfluxbox_lack-f5f979ef374623fffc321300ec7f699acd20e426.zip
fluxbox_lack-f5f979ef374623fffc321300ec7f699acd20e426.tar.bz2
make client windows only reparented one below toplevel - i.e. not into
clientarea
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc31
-rw-r--r--src/FbWinFrame.hh4
-rw-r--r--src/Window.cc87
-rw-r--r--src/Window.hh6
-rw-r--r--src/fluxbox.cc5
5 files changed, 73 insertions, 60 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index ccbcaed..0d84fd6 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.59 2003/10/09 16:48:09 rathnor Exp $ 22// $Id: FbWinFrame.cc,v 1.60 2003/10/28 02:17:02 rathnor Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -367,15 +367,17 @@ void FbWinFrame::setClientWindow(Window win) {
367 XSetWindowBorderWidth(display, win, 0); 367 XSetWindowBorderWidth(display, win, 0);
368 368
369 XChangeSaveSet(display, win, SetModeInsert); 369 XChangeSaveSet(display, win, SetModeInsert);
370 370
371 XSelectInput(display, m_clientarea.window(), NoEventMask); 371 XSelectInput(display, m_window.window(), NoEventMask);
372
372 // we need to mask this so we don't get unmap event 373 // we need to mask this so we don't get unmap event
373 XSelectInput(display, win, NoEventMask); 374 XSelectInput(display, win, NoEventMask);
374 XReparentWindow(display, win, m_clientarea.window(), 0, 0); 375 XReparentWindow(display, win, m_window.window(), 0, m_clientarea.y());
375 // remask window so we get events 376 // remask window so we get events
376 XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask | 377 XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask |
377 FocusChangeMask); 378 FocusChangeMask);
378 XSelectInput(display, m_clientarea.window(), SubstructureRedirectMask); 379 XSelectInput(display, m_window.window(), ButtonPressMask | ButtonReleaseMask |
380 ButtonMotionMask | EnterWindowMask | SubstructureRedirectMask);
379 381
380 XFlush(display); 382 XFlush(display);
381 383
@@ -387,8 +389,8 @@ void FbWinFrame::setClientWindow(Window win) {
387 XChangeWindowAttributes(display, win, CWEventMask|CWDontPropagate, &attrib_set); 389 XChangeWindowAttributes(display, win, CWEventMask|CWDontPropagate, &attrib_set);
388 390
389 m_clientarea.raise(); 391 m_clientarea.raise();
390 m_clientarea.showSubwindows(); 392 XRaiseWindow(display, win);
391 393 m_window.showSubwindows();
392} 394}
393 395
394bool FbWinFrame::hideTitlebar() { 396bool FbWinFrame::hideTitlebar() {
@@ -397,7 +399,6 @@ bool FbWinFrame::hideTitlebar() {
397 399
398 m_titlebar.hide(); 400 m_titlebar.hide();
399 m_use_titlebar = false; 401 m_use_titlebar = false;
400 m_clientarea.raise();
401 402
402 // only take away one borderwidth (as the other border is still the "top" border) 403 // only take away one borderwidth (as the other border is still the "top" border)
403 m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() - 404 m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() -
@@ -623,8 +624,12 @@ void FbWinFrame::reconfigure() {
623 gripLeft().height()); 624 gripLeft().height());
624 625
625 // align titlebar and render it 626 // align titlebar and render it
626 if (m_use_titlebar) 627 if (m_use_titlebar) {
627 reconfigureTitlebar(); 628 reconfigureTitlebar();
629 m_titlebar.raise();
630 } else
631 m_titlebar.lower();
632
628 633
629 // leave client+grips alone if we're shaded (it'll get fixed when we unshade) 634 // leave client+grips alone if we're shaded (it'll get fixed when we unshade)
630 if (!m_shaded) { 635 if (!m_shaded) {
@@ -644,10 +649,8 @@ void FbWinFrame::reconfigure() {
644 m_clientarea.moveResize(0, client_top, 649 m_clientarea.moveResize(0, client_top,
645 m_window.width(), client_height); 650 m_window.width(), client_height);
646 651
647
648 if (m_use_handle) { 652 if (m_use_handle) {
649 653
650
651 // align handle and grips 654 // align handle and grips
652 const int grip_height = m_handle.height(); 655 const int grip_height = m_handle.height();
653 const int grip_width = 20; //TODO 656 const int grip_width = 20; //TODO
@@ -662,8 +665,12 @@ void FbWinFrame::reconfigure() {
662 665
663 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, 666 m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw,
664 grip_width, grip_height); 667 grip_width, grip_height);
668 m_handle.raise();
669 } else {
670 m_handle.lower();
665 } 671 }
666 } 672 }
673
667 674
668 // render the theme 675 // render the theme
669 renderButtons(); 676 renderButtons();
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index f1ca769..9c26903 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.hh,v 1.23 2003/10/05 09:03:43 rathnor Exp $ 22// $Id: FbWinFrame.hh,v 1.24 2003/10/28 02:17:02 rathnor Exp $
23 23
24#ifndef FBWINFRAME_HH 24#ifndef FBWINFRAME_HH
25#define FBWINFRAME_HH 25#define FBWINFRAME_HH
@@ -228,7 +228,7 @@ private:
228 FbTk::FbWindow m_handle; ///< handle between grips 228 FbTk::FbWindow m_handle; ///< handle between grips
229 FbTk::FbWindow m_grip_right, ///< rightgrip 229 FbTk::FbWindow m_grip_right, ///< rightgrip
230 m_grip_left; ///< left grip 230 m_grip_left; ///< left grip
231 FbTk::FbWindow m_clientarea; ///< window that holds client window @see setClientWindow 231 FbTk::FbWindow m_clientarea; ///< window that sits behind client window to fill gaps @see setClientWindow
232 //@} 232 //@}
233 typedef std::vector<FbTk::Button *> ButtonList; 233 typedef std::vector<FbTk::Button *> ButtonList;
234 ButtonList m_buttons_left, ///< buttons to the left 234 ButtonList m_buttons_left, ///< buttons to the left
diff --git a/src/Window.cc b/src/Window.cc
index cde054a..cce7d16 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.242 2003/10/26 20:59:07 fluxgen Exp $ 25// $Id: Window.cc,v 1.243 2003/10/28 02:17:02 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -467,12 +467,12 @@ void FluxboxWindow::init() {
467 467
468 upsize(); 468 upsize();
469 469
470 associateClientWindow(); 470 applyDecorations(true);
471
472 associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height);
471 473
472 grabButtons(); 474 grabButtons();
473 475
474 applyDecorations(true);
475
476 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) 476 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount())
477 m_workspace_number = screen().currentWorkspaceID(); 477 m_workspace_number = screen().currentWorkspaceID();
478 478
@@ -504,9 +504,6 @@ void FluxboxWindow::init() {
504 if (wattrib.height <= 0) 504 if (wattrib.height <= 0)
505 wattrib.height = 1; 505 wattrib.height = 1;
506 506
507 frame().moveResizeForClient(wattrib.x, wattrib.y,
508 wattrib.width, wattrib.height);
509
510 // if we're a transient then we should be on the same layer as our parent 507 // if we're a transient then we should be on the same layer as our parent
511 if (m_client->isTransient() && 508 if (m_client->isTransient() &&
512 m_client->transientFor()->fbwindow() && 509 m_client->transientFor()->fbwindow() &&
@@ -558,7 +555,7 @@ void FluxboxWindow::init() {
558 if (m_shaped) 555 if (m_shaped)
559 shape(); 556 shape();
560 557
561 558 XSync(display, false);
562} 559}
563 560
564/// apply shape to this window 561/// apply shape to this window
@@ -607,9 +604,11 @@ void FluxboxWindow::attachClient(WinClient &client) {
607 604
608 // reparent window to this 605 // reparent window to this
609 frame().setClientWindow(**client_it); 606 frame().setClientWindow(**client_it);
610 resizeClient(**client_it, 607 moveResizeClient(**client_it,
611 frame().clientArea().width(), 608 frame().clientArea().x(),
612 frame().clientArea().height()); 609 frame().clientArea().y(),
610 frame().clientArea().width(),
611 frame().clientArea().height());
613 612
614 (*client_it)->m_win = this; 613 (*client_it)->m_win = this;
615 // create a labelbutton for this client and 614 // create a labelbutton for this client and
@@ -910,22 +909,27 @@ bool FluxboxWindow::isGroupable() const {
910 return false; 909 return false;
911} 910}
912 911
913void FluxboxWindow::associateClientWindow() { 912void FluxboxWindow::associateClientWindow(bool use_attrs, int x, int y, unsigned int width, unsigned int height) {
914 m_client->setBorderWidth(0); 913 m_client->setBorderWidth(0);
915 updateTitleFromClient(*m_client); 914 updateTitleFromClient(*m_client);
916 updateIconNameFromClient(*m_client); 915 updateIconNameFromClient(*m_client);
917 916
917 if (use_attrs)
918 frame().moveResizeForClient(x, y,
919 width, height);
920 else
921 frame().resizeForClient(m_client->width(), m_client->height());
922
918 frame().setClientWindow(*m_client); 923 frame().setClientWindow(*m_client);
919 frame().resizeForClient(m_client->width(), m_client->height());
920} 924}
921 925
922 926
923void FluxboxWindow::grabButtons() { 927void FluxboxWindow::grabButtons() {
924 928
925 XGrabButton(display, Button1, AnyModifier, 929 XGrabButton(display, Button1, AnyModifier,
926 frame().clientArea().window(), True, ButtonPressMask, 930 frame().window().window(), True, ButtonPressMask,
927 GrabModeSync, GrabModeSync, None, None); 931 GrabModeSync, GrabModeSync, None, None);
928 XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().clientArea().window()); 932 XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().window().window());
929 933
930 934
931 XGrabButton(display, Button1, Mod1Mask, frame().window().window(), True, 935 XGrabButton(display, Button1, Mod1Mask, frame().window().window(), True,
@@ -2268,13 +2272,13 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
2268 setInputFocus(); 2272 setInputFocus();
2269 } 2273 }
2270 2274
2271 if (frame().clientArea() == be.window) { 2275 if (frame().window().window() == be.window) {
2272 if (screen().clickRaises()) 2276 if (screen().clickRaises())
2273 raise(); 2277 raise();
2274 XAllowEvents(display, ReplayPointer, be.time); 2278 XAllowEvents(display, ReplayPointer, be.time);
2275 } else { 2279
2276 m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth(); 2280 m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
2277 m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth(); 2281 m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
2278 } 2282 }
2279 2283
2280 if (m_windowmenu.isVisible()) 2284 if (m_windowmenu.isVisible())
@@ -2668,7 +2672,7 @@ void FluxboxWindow::applyDecorations(bool initial) {
2668 } 2672 }
2669 2673
2670 frame().reconfigure(); 2674 frame().reconfigure();
2671 if (client_move) 2675 if (!initial && client_move)
2672 sendConfigureNotify(); 2676 sendConfigureNotify();
2673} 2677}
2674 2678
@@ -3234,10 +3238,11 @@ void FluxboxWindow::fixsize(int *user_w, int *user_h) {
3234 3238
3235} 3239}
3236 3240
3237void FluxboxWindow::resizeClient(WinClient &client, 3241void FluxboxWindow::moveResizeClient(WinClient &client, int x, int y,
3238 unsigned int height, unsigned int width) { 3242 unsigned int height, unsigned int width) {
3239 client.resize(frame().clientArea().width(), 3243 client.moveResize(x, y,
3240 frame().clientArea().height()); 3244 frame().clientArea().width(),
3245 frame().clientArea().height());
3241 client.updateRect(frame().x() + frame().clientArea().x(), 3246 client.updateRect(frame().x() + frame().clientArea().x(),
3242 frame().y() + frame().clientArea().y(), 3247 frame().y() + frame().clientArea().y(),
3243 frame().clientArea().width(), 3248 frame().clientArea().width(),
@@ -3256,29 +3261,29 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) {
3256 //!! 3261 //!!
3257 client.x = frame().x(); 3262 client.x = frame().x();
3258 client.y = frame().y(); 3263 client.y = frame().y();
3259 resizeClient(client, 3264 moveResizeClient(client,
3265 frame().clientArea().x(),
3266 frame().clientArea().y(),
3260 frame().clientArea().width(), 3267 frame().clientArea().width(),
3261 frame().clientArea().height()); 3268 frame().clientArea().height());
3262 3269
3263 3270 if (send_to_netizens) {
3264 XEvent event; 3271 XEvent event;
3265 event.type = ConfigureNotify; 3272 event.type = ConfigureNotify;
3266 3273
3267 event.xconfigure.display = display; 3274 event.xconfigure.display = display;
3268 event.xconfigure.event = client.window(); 3275 event.xconfigure.event = client.window();
3269 event.xconfigure.window = client.window(); 3276 event.xconfigure.window = client.window();
3270 event.xconfigure.x = frame().x() + frame().clientArea().x(); 3277 event.xconfigure.x = frame().x() + frame().clientArea().x();
3271 event.xconfigure.y = frame().y() + frame().clientArea().y(); 3278 event.xconfigure.y = frame().y() + frame().clientArea().y();
3272 event.xconfigure.width = client.width(); 3279 event.xconfigure.width = client.width();
3273 event.xconfigure.height = client.height(); 3280 event.xconfigure.height = client.height();
3274 event.xconfigure.border_width = client.old_bw; 3281 event.xconfigure.border_width = client.old_bw;
3275 event.xconfigure.above = frame().window().window(); 3282 event.xconfigure.above = frame().window().window();
3276 event.xconfigure.override_redirect = false; 3283 event.xconfigure.override_redirect = false;
3277 3284
3278 XSendEvent(display, client.window(), False, StructureNotifyMask, &event);
3279
3280 if (send_to_netizens)
3281 screen().updateNetizenConfigNotify(event); 3285 screen().updateNetizenConfigNotify(event);
3286 }
3282 } // end for 3287 } // end for
3283} 3288}
3284 3289
diff --git a/src/Window.hh b/src/Window.hh
index 480d637..7db118c 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -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.hh,v 1.99 2003/10/06 06:22:43 rathnor Exp $ 25// $Id: Window.hh,v 1.100 2003/10/28 02:17:03 rathnor Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -388,7 +388,7 @@ private:
388 void updateBlackboxHintsFromClient(WinClient &client); 388 void updateBlackboxHintsFromClient(WinClient &client);
389 void saveBlackboxAttribs(); 389 void saveBlackboxAttribs();
390 void setNetWMAttributes(); 390 void setNetWMAttributes();
391 void associateClientWindow(); 391 void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1);
392 392
393 void restoreGravity(); 393 void restoreGravity();
394 void setGravityOffsets(); 394 void setGravityOffsets();
@@ -400,7 +400,7 @@ private:
400 void doSnapping(int &left, int &top); 400 void doSnapping(int &left, int &top);
401 // user_w/h return the values that should be shown to the user 401 // user_w/h return the values that should be shown to the user
402 void fixsize(int *user_w = 0, int *user_h = 0); 402 void fixsize(int *user_w = 0, int *user_h = 0);
403 void resizeClient(WinClient &client, unsigned int width, unsigned int height); 403 void moveResizeClient(WinClient &client, int x, int y, unsigned int width, unsigned int height);
404 /// sends configurenotify to all clients 404 /// sends configurenotify to all clients
405 void sendConfigureNotify(bool send_to_netizens = true); 405 void sendConfigureNotify(bool send_to_netizens = true);
406 // state and hint signals 406 // state and hint signals
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 50cb292..7b6f0b8 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.200 2003/10/14 16:23:15 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.201 2003/10/28 02:17:03 rathnor Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -560,11 +560,12 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
560 screen->workspaceCountSig().attach(this); 560 screen->workspaceCountSig().attach(this);
561 screen->workspaceNamesSig().attach(this); 561 screen->workspaceNamesSig().attach(this);
562 screen->clientListSig().attach(this); 562 screen->clientListSig().attach(this);
563 563
564 // initiate atomhandler for screen specific stuff 564 // initiate atomhandler for screen specific stuff
565 for (size_t atomh=0; atomh<m_atomhandler.size(); ++atomh) { 565 for (size_t atomh=0; atomh<m_atomhandler.size(); ++atomh) {
566 m_atomhandler[atomh]->initForScreen(*screen); 566 m_atomhandler[atomh]->initForScreen(*screen);
567 } 567 }
568 revertFocus(*screen, false); // make sure focus style is correct
568 569
569 } 570 }
570 m_keyscreen = m_mousescreen = m_screen_list.front(); 571 m_keyscreen = m_mousescreen = m_screen_list.front();