diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-21 14:05:44 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-21 14:05:44 (GMT) |
commit | 533c70cb570c56a586f8946700f57a832128a705 (patch) | |
tree | 72540dbd91014a29d10c9f798fd17f6a59c71504 /src | |
parent | 0116a83aa6b5275cbe3cd2bd851dc6959cacf79b (diff) | |
download | fluxbox-533c70cb570c56a586f8946700f57a832128a705.zip fluxbox-533c70cb570c56a586f8946700f57a832128a705.tar.bz2 |
some cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 16 | ||||
-rw-r--r-- | src/WinClient.cc | 10 | ||||
-rw-r--r-- | src/WinClient.hh | 3 | ||||
-rw-r--r-- | src/Window.cc | 182 | ||||
-rw-r--r-- | src/Window.hh | 26 |
5 files changed, 44 insertions, 193 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index d4ca980..da6fd74 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -674,10 +674,7 @@ void FbWinFrame::setClientWindow(FbTk::FbWindow &win) { | |||
674 | 674 | ||
675 | // we need to mask this so we don't get unmap event | 675 | // we need to mask this so we don't get unmap event |
676 | win.setEventMask(NoEventMask); | 676 | win.setEventMask(NoEventMask); |
677 | win.reparent(m_window, 0, clientArea().y()); | 677 | win.reparent(m_window, clientArea().x(), clientArea().y()); |
678 | // remask window so we get events | ||
679 | win.setEventMask(PropertyChangeMask | StructureNotifyMask | | ||
680 | FocusChangeMask | KeyPressMask); | ||
681 | 678 | ||
682 | m_window.setEventMask(ButtonPressMask | ButtonReleaseMask | | 679 | m_window.setEventMask(ButtonPressMask | ButtonReleaseMask | |
683 | ButtonMotionMask | EnterWindowMask | | 680 | ButtonMotionMask | EnterWindowMask | |
@@ -685,14 +682,14 @@ void FbWinFrame::setClientWindow(FbTk::FbWindow &win) { | |||
685 | 682 | ||
686 | XFlush(win.display()); | 683 | XFlush(win.display()); |
687 | 684 | ||
685 | // remask window so we get events | ||
688 | XSetWindowAttributes attrib_set; | 686 | XSetWindowAttributes attrib_set; |
689 | attrib_set.event_mask = PropertyChangeMask | StructureNotifyMask | FocusChangeMask; | 687 | attrib_set.event_mask = PropertyChangeMask | StructureNotifyMask | FocusChangeMask | KeyPressMask; |
690 | attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | | 688 | attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | |
691 | ButtonMotionMask; | 689 | ButtonMotionMask; |
692 | 690 | ||
693 | XChangeWindowAttributes(win.display(), win.window(), CWEventMask|CWDontPropagate, &attrib_set); | 691 | XChangeWindowAttributes(win.display(), win.window(), CWEventMask|CWDontPropagate, &attrib_set); |
694 | 692 | ||
695 | m_clientarea.raise(); | ||
696 | if (isVisible()) | 693 | if (isVisible()) |
697 | win.show(); | 694 | win.show(); |
698 | win.raise(); | 695 | win.raise(); |
@@ -808,7 +805,6 @@ void FbWinFrame::setEventHandler(FbTk::EventHandler &evh) { | |||
808 | evm.add(evh, m_grip_right); | 805 | evm.add(evh, m_grip_right); |
809 | evm.add(evh, m_grip_left); | 806 | evm.add(evh, m_grip_left); |
810 | evm.add(evh, m_window); | 807 | evm.add(evh, m_window); |
811 | evm.add(evh, m_clientarea); | ||
812 | } | 808 | } |
813 | 809 | ||
814 | /** | 810 | /** |
@@ -823,7 +819,6 @@ void FbWinFrame::removeEventHandler() { | |||
823 | evm.remove(m_grip_right); | 819 | evm.remove(m_grip_right); |
824 | evm.remove(m_grip_left); | 820 | evm.remove(m_grip_left); |
825 | evm.remove(m_window); | 821 | evm.remove(m_window); |
826 | evm.remove(m_clientarea); | ||
827 | } | 822 | } |
828 | 823 | ||
829 | void FbWinFrame::exposeEvent(XExposeEvent &event) { | 824 | void FbWinFrame::exposeEvent(XExposeEvent &event) { |
@@ -1344,7 +1339,6 @@ void FbWinFrame::init() { | |||
1344 | 1339 | ||
1345 | m_button_size = 26; | 1340 | m_button_size = 26; |
1346 | 1341 | ||
1347 | m_clientarea.setBorderWidth(0); | ||
1348 | m_label.setBorderWidth(0); | 1342 | m_label.setBorderWidth(0); |
1349 | m_state.shaded = false; | 1343 | m_state.shaded = false; |
1350 | 1344 | ||
@@ -1360,6 +1354,10 @@ void FbWinFrame::init() { | |||
1360 | // Note: we don't show clientarea yet | 1354 | // Note: we don't show clientarea yet |
1361 | 1355 | ||
1362 | setEventHandler(*this); | 1356 | setEventHandler(*this); |
1357 | |||
1358 | // setup cursors for resize grips | ||
1359 | gripLeft().setCursor(theme()->lowerLeftAngleCursor()); | ||
1360 | gripRight().setCursor(theme()->lowerRightAngleCursor()); | ||
1363 | } | 1361 | } |
1364 | 1362 | ||
1365 | /** | 1363 | /** |
diff --git a/src/WinClient.cc b/src/WinClient.cc index 14414b0..bded700 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc | |||
@@ -66,7 +66,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): | |||
66 | Focusable(screen, fbwin), FbTk::FbWindow(win), | 66 | Focusable(screen, fbwin), FbTk::FbWindow(win), |
67 | transient_for(0), | 67 | transient_for(0), |
68 | window_group(0), | 68 | window_group(0), |
69 | x(0), y(0), old_bw(0), | 69 | old_bw(0), |
70 | initial_state(0), | 70 | initial_state(0), |
71 | normal_hint_flags(0), | 71 | normal_hint_flags(0), |
72 | wm_hint_flags(0), | 72 | wm_hint_flags(0), |
@@ -81,6 +81,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): | |||
81 | m_mwm_hint(0), | 81 | m_mwm_hint(0), |
82 | m_strut(0) { | 82 | m_strut(0) { |
83 | 83 | ||
84 | old_bw = borderWidth(); | ||
84 | updateWMProtocols(); | 85 | updateWMProtocols(); |
85 | updateMWMHints(); | 86 | updateMWMHints(); |
86 | updateWMHints(); | 87 | updateWMHints(); |
@@ -367,13 +368,6 @@ void WinClient::setIcon(const FbTk::PixmapWithMask& pm) { | |||
367 | titleSig().notify(); | 368 | titleSig().notify(); |
368 | } | 369 | } |
369 | 370 | ||
370 | void WinClient::saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs, int nelements) { | ||
371 | changeProperty(FbAtoms::instance()->getFluxboxAttributesAtom(), | ||
372 | XA_CARDINAL, 32, PropModeReplace, | ||
373 | (unsigned char *)&blackbox_attribs, | ||
374 | nelements); | ||
375 | } | ||
376 | |||
377 | void WinClient::setFluxboxWindow(FluxboxWindow *win) { | 371 | void WinClient::setFluxboxWindow(FluxboxWindow *win) { |
378 | m_fbwin = win; | 372 | m_fbwin = win; |
379 | } | 373 | } |
diff --git a/src/WinClient.hh b/src/WinClient.hh index a119f7d..18c9b0b 100644 --- a/src/WinClient.hh +++ b/src/WinClient.hh | |||
@@ -81,7 +81,6 @@ public: | |||
81 | 81 | ||
82 | void setGroupLeftWindow(Window win); | 82 | void setGroupLeftWindow(Window win); |
83 | 83 | ||
84 | void saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs, int nelements); | ||
85 | void setFluxboxWindow(FluxboxWindow *win); | 84 | void setFluxboxWindow(FluxboxWindow *win); |
86 | 85 | ||
87 | // does this client have a pending unmap or destroy event? | 86 | // does this client have a pending unmap or destroy event? |
@@ -136,7 +135,7 @@ public: | |||
136 | Window window_group; | 135 | Window window_group; |
137 | 136 | ||
138 | 137 | ||
139 | int x, y, old_bw; | 138 | int old_bw; |
140 | unsigned long initial_state, normal_hint_flags, wm_hint_flags; | 139 | unsigned long initial_state, normal_hint_flags, wm_hint_flags; |
141 | 140 | ||
142 | private: | 141 | private: |
diff --git a/src/Window.cc b/src/Window.cc index d5679d4..73da2d4 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -388,13 +388,19 @@ FluxboxWindow::~FluxboxWindow() { | |||
388 | void FluxboxWindow::init() { | 388 | void FluxboxWindow::init() { |
389 | m_attaching_tab = 0; | 389 | m_attaching_tab = 0; |
390 | 390 | ||
391 | assert(m_client); | 391 | // fetch client size and placement |
392 | XWindowAttributes wattrib; | ||
393 | if (! m_client->getAttrib(wattrib) || | ||
394 | !wattrib.screen || // no screen? ?? | ||
395 | wattrib.override_redirect || // override redirect | ||
396 | m_client->initial_state == WithdrawnState) // Slit client | ||
397 | return; | ||
398 | |||
392 | m_client->setFluxboxWindow(this); | 399 | m_client->setFluxboxWindow(this); |
393 | m_client->setGroupLeftWindow(None); // nothing to the left. | 400 | m_client->setGroupLeftWindow(None); // nothing to the left. |
394 | 401 | ||
395 | if (Fluxbox::instance()->haveShape()) { | 402 | if (Fluxbox::instance()->haveShape()) |
396 | Shape::setShapeNotify(winClient()); | 403 | Shape::setShapeNotify(winClient()); |
397 | } | ||
398 | 404 | ||
399 | //!! TODO init of client should be better | 405 | //!! TODO init of client should be better |
400 | // we don't want to duplicate code here and in attachClient | 406 | // we don't want to duplicate code here and in attachClient |
@@ -407,24 +413,18 @@ void FluxboxWindow::init() { | |||
407 | 413 | ||
408 | Fluxbox &fluxbox = *Fluxbox::instance(); | 414 | Fluxbox &fluxbox = *Fluxbox::instance(); |
409 | 415 | ||
410 | // setup cursors for resize grips | ||
411 | frame().gripLeft().setCursor(frame().theme()->lowerLeftAngleCursor()); | ||
412 | frame().gripRight().setCursor(frame().theme()->lowerRightAngleCursor()); | ||
413 | |||
414 | associateClient(*m_client); | 416 | associateClient(*m_client); |
415 | 417 | ||
416 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); | 418 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); |
417 | 419 | ||
418 | // redirect events from frame to us | 420 | // redirect events from frame to us |
419 | frame().setEventHandler(*this); | 421 | frame().setEventHandler(*this); |
422 | fluxbox.saveWindowSearchGroup(frame().window().window(), this); | ||
423 | fluxbox.saveWindowSearchGroup(frame().tabcontainer().window(), this); | ||
420 | 424 | ||
421 | frame().resize(m_client->width(), m_client->height()); | 425 | frame().resize(m_client->width(), m_client->height()); |
422 | 426 | ||
423 | m_blackbox_attrib.workspace = m_workspace_number = m_screen.currentWorkspaceID(); | 427 | m_workspace_number = m_screen.currentWorkspaceID(); |
424 | |||
425 | m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0; | ||
426 | m_blackbox_attrib.premax_x = m_blackbox_attrib.premax_y = 0; | ||
427 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; | ||
428 | 428 | ||
429 | // set default decorations but don't apply them | 429 | // set default decorations but don't apply them |
430 | setDecorationMask(FbWinFrame::getDecoMaskFromString(screen().defaultDeco()), | 430 | setDecorationMask(FbWinFrame::getDecoMaskFromString(screen().defaultDeco()), |
@@ -435,45 +435,27 @@ void FluxboxWindow::init() { | |||
435 | 435 | ||
436 | updateMWMHintsFromClient(*m_client); | 436 | updateMWMHintsFromClient(*m_client); |
437 | 437 | ||
438 | //!! | ||
439 | // fetch client size and placement | ||
440 | XWindowAttributes wattrib; | ||
441 | if (! m_client->getAttrib(wattrib) || | ||
442 | !wattrib.screen || // no screen? ?? | ||
443 | wattrib.override_redirect || // override redirect | ||
444 | m_client->initial_state == WithdrawnState) // Slit client | ||
445 | return; | ||
446 | |||
447 | // save old border width so we can restore it later | ||
448 | m_client->old_bw = wattrib.border_width; | ||
449 | m_client->x = wattrib.x; m_client->y = wattrib.y; | ||
450 | |||
451 | m_timer.setTimeout(fluxbox.getAutoRaiseDelay()); | 438 | m_timer.setTimeout(fluxbox.getAutoRaiseDelay()); |
452 | FbTk::RefCount<FbTk::Command<void> > raise_cmd(new FbTk::SimpleCommand<FluxboxWindow>(*this, | 439 | FbTk::RefCount<FbTk::Command<void> > raise_cmd(new FbTk::SimpleCommand<FluxboxWindow>(*this, |
453 | &FluxboxWindow::raise)); | 440 | &FluxboxWindow::raise)); |
454 | m_timer.setCommand(raise_cmd); | 441 | m_timer.setCommand(raise_cmd); |
455 | m_timer.fireOnce(true); | 442 | m_timer.fireOnce(true); |
456 | 443 | ||
457 | Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this); | ||
458 | Fluxbox::instance()->saveWindowSearchGroup(frame().tabcontainer().window(), this); | ||
459 | |||
460 | /**************************************************/ | 444 | /**************************************************/ |
461 | /* Read state above here, apply state below here. */ | 445 | /* Read state above here, apply state below here. */ |
462 | /**************************************************/ | 446 | /**************************************************/ |
463 | 447 | ||
464 | if (m_client->transientFor() && m_client->transientFor()->fbwindow() && | 448 | if (m_client->isTransient()) { |
465 | m_client->transientFor()->fbwindow()->isStuck()) | 449 | if (m_client->transientFor()->fbwindow()) |
466 | stick(); | 450 | stuck = m_client->transientFor()->fbwindow()->isStuck(); |
467 | 451 | ||
468 | // adjust the window decorations based on transience and window sizes | 452 | if (!screen().decorateTransient()) { |
469 | if (m_client->isTransient() && !screen().decorateTransient()) { | 453 | decorations.maximize = functions.maximize = false; |
470 | decorations.maximize = functions.maximize = false; | 454 | decorations.handle = false; |
471 | decorations.handle = false; | 455 | } |
472 | } | 456 | } |
473 | 457 | ||
474 | if ((m_client->normal_hint_flags & PMinSize) && | 458 | if (m_client->maxWidth() != 0 && m_client->maxHeight() != 0 && |
475 | (m_client->normal_hint_flags & PMaxSize) && | ||
476 | m_client->maxWidth() != 0 && m_client->maxHeight() != 0 && | ||
477 | m_client->maxWidth() <= m_client->minWidth() && | 459 | m_client->maxWidth() <= m_client->minWidth() && |
478 | m_client->maxHeight() <= m_client->minHeight()) { | 460 | m_client->maxHeight() <= m_client->minHeight()) { |
479 | decorations.maximize = decorations.handle = | 461 | decorations.maximize = decorations.handle = |
@@ -481,10 +463,7 @@ void FluxboxWindow::init() { | |||
481 | decorations.tab = false; //no tab for this window | 463 | decorations.tab = false; //no tab for this window |
482 | } | 464 | } |
483 | 465 | ||
484 | associateClientWindow(true, | 466 | associateClientWindow(); |
485 | wattrib.x, wattrib.y, | ||
486 | wattrib.width, wattrib.height, | ||
487 | m_client->gravity(), m_client->old_bw); | ||
488 | 467 | ||
489 | setWindowType(m_client->getWindowType()); | 468 | setWindowType(m_client->getWindowType()); |
490 | 469 | ||
@@ -513,18 +492,9 @@ void FluxboxWindow::init() { | |||
513 | // this window is managed, we are now allowed to modify actual state | 492 | // this window is managed, we are now allowed to modify actual state |
514 | m_initialized = true; | 493 | m_initialized = true; |
515 | 494 | ||
516 | restoreAttributes(); | ||
517 | |||
518 | if (m_workspace_number >= screen().numberOfWorkspaces()) | 495 | if (m_workspace_number >= screen().numberOfWorkspaces()) |
519 | m_workspace_number = screen().currentWorkspaceID(); | 496 | m_workspace_number = screen().currentWorkspaceID(); |
520 | 497 | ||
521 | /* | ||
522 | if (wattrib.width <= 0) | ||
523 | wattrib.width = 1; | ||
524 | if (wattrib.height <= 0) | ||
525 | wattrib.height = 1; | ||
526 | */ | ||
527 | |||
528 | // if we're a transient then we should be on the same layer as our parent | 498 | // if we're a transient then we should be on the same layer as our parent |
529 | if (m_client->isTransient() && | 499 | if (m_client->isTransient() && |
530 | m_client->transientFor()->fbwindow() && | 500 | m_client->transientFor()->fbwindow() && |
@@ -535,13 +505,12 @@ void FluxboxWindow::init() { | |||
535 | 505 | ||
536 | // transients should be on the same workspace as parent | 506 | // transients should be on the same workspace as parent |
537 | if (m_client->isTransient() && | 507 | if (m_client->isTransient() && |
538 | m_client->transientFor()->fbwindow() && | 508 | m_client->transientFor()->fbwindow()) { |
539 | m_client->transientFor()->fbwindow() != this) { | ||
540 | m_workspace_number = | 509 | m_workspace_number = |
541 | m_client->transientFor()->fbwindow()->workspaceNumber(); | 510 | m_client->transientFor()->fbwindow()->workspaceNumber(); |
542 | } | 511 | } |
543 | 512 | ||
544 | 513 | ||
545 | #ifdef DEBUG | 514 | #ifdef DEBUG |
546 | cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<< | 515 | cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<< |
547 | m_client->transientFor()<<endl; | 516 | m_client->transientFor()<<endl; |
@@ -551,10 +520,8 @@ void FluxboxWindow::init() { | |||
551 | } | 520 | } |
552 | #endif // DEBUG | 521 | #endif // DEBUG |
553 | 522 | ||
554 | unsigned int real_width = frame().width(); | 523 | unsigned int real_width = frame().width(), real_height = frame().height() |
555 | unsigned int real_height = frame().height() - frame().titlebarHeight() - frame().handleHeight(); | 524 | frame().applySizeHints(real_width, real_height); |
556 | frame().sizeHints().apply(real_width, real_height); | ||
557 | real_height += frame().titlebarHeight() + frame().handleHeight(); | ||
558 | 525 | ||
559 | if (m_placed) | 526 | if (m_placed) |
560 | moveResize(frame().x(), frame().y(), real_width, real_height); | 527 | moveResize(frame().x(), frame().y(), real_width, real_height); |
@@ -665,9 +632,6 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) { | |||
665 | //null if we want the new button at the end of the list | 632 | //null if we want the new button at the end of the list |
666 | if (x >= 0 && button_insert_pos) | 633 | if (x >= 0 && button_insert_pos) |
667 | frame().moveLabelButtonLeftOf(*m_labelbuttons[*client_it], *button_insert_pos); | 634 | frame().moveLabelButtonLeftOf(*m_labelbuttons[*client_it], *button_insert_pos); |
668 | |||
669 | (*client_it)->saveBlackboxAttribs(m_blackbox_attrib, | ||
670 | PropBlackboxAttributesElements); | ||
671 | } | 635 | } |
672 | 636 | ||
673 | // add client and move over all attached clients | 637 | // add client and move over all attached clients |
@@ -695,8 +659,6 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) { | |||
695 | m_focused = focusRequestFromClient(client); | 659 | m_focused = focusRequestFromClient(client); |
696 | focused_win = (m_focus_new || is_startup) ? &client : m_client; | 660 | focused_win = (m_focus_new || is_startup) ? &client : m_client; |
697 | 661 | ||
698 | client.saveBlackboxAttribs(m_blackbox_attrib, | ||
699 | PropBlackboxAttributesElements); | ||
700 | m_clientlist.push_back(&client); | 662 | m_clientlist.push_back(&client); |
701 | } | 663 | } |
702 | 664 | ||
@@ -1076,21 +1038,13 @@ bool FluxboxWindow::isGroupable() const { | |||
1076 | return false; | 1038 | return false; |
1077 | } | 1039 | } |
1078 | 1040 | ||
1079 | void FluxboxWindow::associateClientWindow(bool use_attrs, | 1041 | void FluxboxWindow::associateClientWindow() { |
1080 | int x, int y, | ||
1081 | unsigned int width, unsigned int height, | ||
1082 | int gravity, unsigned int client_bw) { | ||
1083 | m_client->updateTitle(); | ||
1084 | |||
1085 | frame().setShapingClient(m_client, false); | 1042 | frame().setShapingClient(m_client, false); |
1086 | 1043 | ||
1087 | if (use_attrs) | 1044 | frame().moveResizeForClient(m_client->x(), m_client->y(), |
1088 | frame().moveResizeForClient(x, y, | 1045 | m_client->width(), m_client->height(), |
1089 | width, height, gravity, client_bw); | 1046 | m_client->gravity(), m_client->old_bw); |
1090 | else | ||
1091 | frame().resizeForClient(m_client->width(), m_client->height()); | ||
1092 | 1047 | ||
1093 | frame().setActiveGravity(m_client->gravity(), m_client->old_bw); | ||
1094 | frame().setSizeHints(m_client->sizeHints()); | 1048 | frame().setSizeHints(m_client->sizeHints()); |
1095 | frame().setClientWindow(*m_client); | 1049 | frame().setClientWindow(*m_client); |
1096 | } | 1050 | } |
@@ -1719,12 +1673,7 @@ void FluxboxWindow::setWorkspace(int n) { | |||
1719 | void FluxboxWindow::setLayerNum(int layernum) { | 1673 | void FluxboxWindow::setLayerNum(int layernum) { |
1720 | m_layernum = layernum; | 1674 | m_layernum = layernum; |
1721 | 1675 | ||
1722 | m_blackbox_attrib.flags |= ATTRIB_STACK; | ||
1723 | m_blackbox_attrib.stack = layernum; | ||
1724 | |||
1725 | if (m_initialized) { | 1676 | if (m_initialized) { |
1726 | saveBlackboxAttribs(); | ||
1727 | |||
1728 | #ifdef DEBUG | 1677 | #ifdef DEBUG |
1729 | cerr<<this<<" notify layer signal"<<endl; | 1678 | cerr<<this<<" notify layer signal"<<endl; |
1730 | #endif // DEBUG | 1679 | #endif // DEBUG |
@@ -1779,8 +1728,8 @@ void FluxboxWindow::stick() { | |||
1779 | WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); | 1728 | WinClient::TransientList::const_iterator it = (*client_it)->transientList().begin(); |
1780 | WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); | 1729 | WinClient::TransientList::const_iterator it_end = (*client_it)->transientList().end(); |
1781 | for (; it != it_end; ++it) { | 1730 | for (; it != it_end; ++it) { |
1782 | if ((*it)->fbwindow() && (*it)->fbwindow()->isStuck() != stuck) | 1731 | if ((*it)->fbwindow()) |
1783 | (*it)->fbwindow()->stick(); | 1732 | (*it)->fbwindow()->setStuck(stuck); |
1784 | } | 1733 | } |
1785 | 1734 | ||
1786 | } | 1735 | } |
@@ -2009,20 +1958,6 @@ void FluxboxWindow::installColormap(bool install) { | |||
2009 | } | 1958 | } |
2010 | 1959 | ||
2011 | /** | 1960 | /** |
2012 | Saves blackbox attributes for every client in our list | ||
2013 | */ | ||
2014 | void FluxboxWindow::saveBlackboxAttribs() { | ||
2015 | for_each(m_clientlist.begin(), m_clientlist.end(), | ||
2016 | ChangeProperty( | ||
2017 | display, | ||
2018 | FbAtoms::instance()->getFluxboxAttributesAtom(), | ||
2019 | PropModeReplace, | ||
2020 | (unsigned char *)&m_blackbox_attrib, | ||
2021 | PropBlackboxAttributesElements | ||
2022 | )); | ||
2023 | } | ||
2024 | |||
2025 | /** | ||
2026 | Sets state on each client in our list | 1961 | Sets state on each client in our list |
2027 | Use setting_up for setting startup state - it may not be committed yet | 1962 | Use setting_up for setting startup state - it may not be committed yet |
2028 | That'll happen when its mapped | 1963 | That'll happen when its mapped |
@@ -2077,53 +2012,6 @@ bool FluxboxWindow::getState() { | |||
2077 | } | 2012 | } |
2078 | 2013 | ||
2079 | /** | 2014 | /** |
2080 | * Sets the attributes to what they should be | ||
2081 | * but doesn't change the actual state | ||
2082 | * (so the caller can set defaults etc as well) | ||
2083 | */ | ||
2084 | void FluxboxWindow::restoreAttributes() { | ||
2085 | if (!getState()) { | ||
2086 | m_current_state = m_client->initial_state; | ||
2087 | if (m_current_state == IconicState) | ||
2088 | iconic = true; | ||
2089 | } | ||
2090 | |||
2091 | Atom atom_return; | ||
2092 | int foo; | ||
2093 | unsigned long ulfoo, nitems; | ||
2094 | FbAtoms *fbatoms = FbAtoms::instance(); | ||
2095 | |||
2096 | BlackboxAttributes *net; | ||
2097 | if (m_client->property(fbatoms->getFluxboxAttributesAtom(), 0l, | ||
2098 | PropBlackboxAttributesElements, false, | ||
2099 | fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, | ||
2100 | &nitems, &ulfoo, (unsigned char **) &net) && | ||
2101 | net) { | ||
2102 | if (nitems != (unsigned)PropBlackboxAttributesElements) { | ||
2103 | XFree(net); | ||
2104 | return; | ||
2105 | } | ||
2106 | m_blackbox_attrib.flags = net->flags; | ||
2107 | m_blackbox_attrib.attrib = net->attrib; | ||
2108 | m_blackbox_attrib.workspace = net->workspace; | ||
2109 | m_blackbox_attrib.stack = net->stack; | ||
2110 | m_blackbox_attrib.premax_x = net->premax_x; | ||
2111 | m_blackbox_attrib.premax_y = net->premax_y; | ||
2112 | m_blackbox_attrib.premax_w = net->premax_w; | ||
2113 | m_blackbox_attrib.premax_h = net->premax_h; | ||
2114 | |||
2115 | XFree(static_cast<void *>(net)); | ||
2116 | } else | ||
2117 | return; | ||
2118 | |||
2119 | if (m_blackbox_attrib.flags & ATTRIB_STACK) { | ||
2120 | //!! TODO check value? | ||
2121 | m_layernum = m_blackbox_attrib.stack; | ||
2122 | } | ||
2123 | |||
2124 | } | ||
2125 | |||
2126 | /** | ||
2127 | Show the window menu at pos mx, my | 2015 | Show the window menu at pos mx, my |
2128 | */ | 2016 | */ |
2129 | void FluxboxWindow::showMenu(int menu_x, int menu_y) { | 2017 | void FluxboxWindow::showMenu(int menu_x, int menu_y) { |
@@ -2243,7 +2131,7 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) { | |||
2243 | } | 2131 | } |
2244 | 2132 | ||
2245 | // Note: this function never gets called from WithdrawnState | 2133 | // Note: this function never gets called from WithdrawnState |
2246 | // initial state is handled in restoreAttributes() and init() | 2134 | // initial state is handled in init() |
2247 | 2135 | ||
2248 | setCurrentClient(*client, false); // focus handled on MapNotify | 2136 | setCurrentClient(*client, false); // focus handled on MapNotify |
2249 | deiconify(); | 2137 | deiconify(); |
@@ -2610,7 +2498,6 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { | |||
2610 | bool onTitlebar = frame().gripLeft().window() != be.window && | 2498 | bool onTitlebar = frame().gripLeft().window() != be.window && |
2611 | frame().gripRight().window() != be.window && | 2499 | frame().gripRight().window() != be.window && |
2612 | frame().handle().window() != be.window && | 2500 | frame().handle().window() != be.window && |
2613 | frame().clientArea().window() != be.window && | ||
2614 | frame().window() != be.window; | 2501 | frame().window() != be.window; |
2615 | 2502 | ||
2616 | if (onTitlebar && be.button == 1) | 2503 | if (onTitlebar && be.button == 1) |
@@ -2670,7 +2557,6 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2670 | 2557 | ||
2671 | bool inside_titlebar = frame().gripLeft().window() != me.window && | 2558 | bool inside_titlebar = frame().gripLeft().window() != me.window && |
2672 | frame().gripRight().window() != me.window && | 2559 | frame().gripRight().window() != me.window && |
2673 | frame().clientArea().window() != me.window && | ||
2674 | frame().window() != me.window; | 2560 | frame().window() != me.window; |
2675 | 2561 | ||
2676 | if (Fluxbox::instance()->getIgnoreBorder() && m_attaching_tab == 0 | 2562 | if (Fluxbox::instance()->getIgnoreBorder() && m_attaching_tab == 0 |
@@ -3733,8 +3619,6 @@ void FluxboxWindow::sendConfigureNotify() { | |||
3733 | of the client window is. (ie frame pos + client pos inside the frame = send pos) | 3619 | of the client window is. (ie frame pos + client pos inside the frame = send pos) |
3734 | */ | 3620 | */ |
3735 | //!! | 3621 | //!! |
3736 | client.x = frame().x(); | ||
3737 | client.y = frame().y(); | ||
3738 | moveResizeClient(client, | 3622 | moveResizeClient(client, |
3739 | frame().clientArea().x(), | 3623 | frame().clientArea().x(), |
3740 | frame().clientArea().y(), | 3624 | frame().clientArea().y(), |
diff --git a/src/Window.hh b/src/Window.hh index 9780ef2..14f063a 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -87,18 +87,6 @@ public: | |||
87 | MwmDecorMaximize = (1l << 6) /// maximize | 87 | MwmDecorMaximize = (1l << 6) /// maximize |
88 | }; | 88 | }; |
89 | 89 | ||
90 | /// attributes for BlackboxHints | ||
91 | enum Attrib { | ||
92 | ATTRIB_SHADED = 0x01, ///< shaded | ||
93 | ATTRIB_MAXHORIZ = 0x02, ///< maximized horizontal | ||
94 | ATTRIB_MAXVERT = 0x04, ///< maximized vertical | ||
95 | ATTRIB_OMNIPRESENT = 0x08, ///< omnipresent (sticky) | ||
96 | ATTRIB_WORKSPACE = 0x10, ///< workspace | ||
97 | ATTRIB_STACK = 0x20, ///< stack | ||
98 | ATTRIB_DECORATION = 0x40, ///< decorations | ||
99 | ATTRIB_HIDDEN = 0x80 ///< hidden | ||
100 | }; | ||
101 | |||
102 | /** | 90 | /** |
103 | * Types of maximization | 91 | * Types of maximization |
104 | */ | 92 | */ |
@@ -141,13 +129,6 @@ public: | |||
141 | CENTER = 8 | 129 | CENTER = 8 |
142 | }; | 130 | }; |
143 | 131 | ||
144 | /// holds old blackbox attributes | ||
145 | typedef struct _blackbox_attributes { | ||
146 | unsigned long flags, attrib, workspace, stack; | ||
147 | long premax_x, premax_y; | ||
148 | unsigned long premax_w, premax_h; | ||
149 | } BlackboxAttributes; | ||
150 | |||
151 | typedef std::list<WinClient *> ClientList; | 132 | typedef std::list<WinClient *> ClientList; |
152 | 133 | ||
153 | /// create a window from a client | 134 | /// create a window from a client |
@@ -308,7 +289,6 @@ public: | |||
308 | void getMaxSize(unsigned int* width, unsigned int* height) const; | 289 | void getMaxSize(unsigned int* width, unsigned int* height) const; |
309 | void setWorkspace(int n); | 290 | void setWorkspace(int n); |
310 | void updateFunctions(); | 291 | void updateFunctions(); |
311 | void restoreAttributes(); | ||
312 | /** | 292 | /** |
313 | * Show window meny at at given position | 293 | * Show window meny at at given position |
314 | * @param mx position | 294 | * @param mx position |
@@ -507,8 +487,6 @@ public: | |||
507 | bool oplock; ///< Used to help stop transient loops occurring by locking a window during certain operations | 487 | bool oplock; ///< Used to help stop transient loops occurring by locking a window during certain operations |
508 | 488 | ||
509 | private: | 489 | private: |
510 | static const int PropBlackboxAttributesElements = 8; | ||
511 | |||
512 | void setupWindow(); | 490 | void setupWindow(); |
513 | void updateButtons(); | 491 | void updateButtons(); |
514 | 492 | ||
@@ -530,8 +508,7 @@ private: | |||
530 | 508 | ||
531 | bool getState(); | 509 | bool getState(); |
532 | void updateMWMHintsFromClient(WinClient &client); | 510 | void updateMWMHintsFromClient(WinClient &client); |
533 | void saveBlackboxAttribs(); | 511 | void associateClientWindow(); |
534 | void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1, int gravity = ForgetGravity, unsigned int client_bw = 0); | ||
535 | 512 | ||
536 | void setState(unsigned long stateval, bool setting_up); | 513 | void setState(unsigned long stateval, bool setting_up); |
537 | /// set the layer of a fullscreen window | 514 | /// set the layer of a fullscreen window |
@@ -574,7 +551,6 @@ private: | |||
574 | 551 | ||
575 | FbTk::Timer m_timer; | 552 | FbTk::Timer m_timer; |
576 | Display *display; /// display connection | 553 | Display *display; /// display connection |
577 | BlackboxAttributes m_blackbox_attrib; | ||
578 | 554 | ||
579 | int m_button_grab_x, m_button_grab_y; // handles last button press event for move | 555 | int m_button_grab_x, m_button_grab_y; // handles last button press event for move |
580 | int m_last_resize_x, m_last_resize_y; // handles last button press event for resize | 556 | int m_last_resize_x, m_last_resize_y; // handles last button press event for resize |