aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc153
1 files changed, 70 insertions, 83 deletions
diff --git a/src/Window.cc b/src/Window.cc
index a6689cb..8ed85ff 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.38 2002/04/04 13:19:10 fluxgen Exp $ 25// $Id: Window.cc,v 1.39 2002/04/04 14:23:30 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -1689,12 +1689,13 @@ void FluxboxWindow::getBlackboxHints(void) {
1689 Fluxbox *fluxbox = Fluxbox::instance(); 1689 Fluxbox *fluxbox = Fluxbox::instance();
1690 1690
1691 if (XGetWindowProperty(display, client.window, 1691 if (XGetWindowProperty(display, client.window,
1692 fluxbox->getFluxboxHintsAtom(), 0, 1692 fluxbox->getFluxboxHintsAtom(), 0,
1693 PropBlackboxHintsElements, false, 1693 PropBlackboxHintsElements, False,
1694 fluxbox->getFluxboxHintsAtom(), &atom_return, 1694 fluxbox->getFluxboxHintsAtom(), &atom_return,
1695 &format, &num, &len, 1695 &format, &num, &len,
1696 (unsigned char **) &client.blackbox_hint) == Success && 1696 (unsigned char **) &client.blackbox_hint) == Success &&
1697 client.blackbox_hint) 1697 client.blackbox_hint) {
1698
1698 if (num == PropBlackboxHintsElements) { 1699 if (num == PropBlackboxHintsElements) {
1699 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_SHADED) 1700 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_SHADED)
1700 shaded = (client.blackbox_hint->attrib & BaseDisplay::ATTRIB_SHADED); 1701 shaded = (client.blackbox_hint->attrib & BaseDisplay::ATTRIB_SHADED);
@@ -1716,46 +1717,11 @@ void FluxboxWindow::getBlackboxHints(void) {
1716 1717
1717 1718
1718 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_DECORATION) { 1719 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_DECORATION) {
1719 switch (client.blackbox_hint->decoration) { 1720 old_decoration = static_cast<Decoration>(client.blackbox_hint->decoration);
1720 case BaseDisplay::DECOR_NONE: 1721 setDecoration(old_decoration);
1721 decorations.titlebar = decorations.border = decorations.handle =
1722 decorations.iconify = decorations.maximize =
1723 decorations.menu = decorations.tab = false; //tab is also a decor
1724 functions.resize = functions.move = functions.iconify =
1725 functions.maximize = false;
1726
1727 break;
1728
1729 default:
1730 case BaseDisplay::DECOR_NORMAL:
1731 decorations.titlebar = decorations.border = decorations.handle =
1732 decorations.iconify = decorations.maximize =
1733 decorations.menu = true;
1734 functions.resize = functions.move = functions.iconify =
1735 functions.maximize = true;
1736
1737 break;
1738
1739 case BaseDisplay::DECOR_TINY:
1740 decorations.titlebar = decorations.iconify = decorations.menu =
1741 functions.move = functions.iconify = true;
1742 decorations.border = decorations.handle = decorations.maximize =
1743 functions.resize = functions.maximize = false;
1744
1745 break;
1746
1747 case BaseDisplay::DECOR_TOOL:
1748 decorations.titlebar = decorations.menu = functions.move = true;
1749 decorations.iconify = decorations.border = decorations.handle =
1750 decorations.maximize = functions.resize = functions.maximize =
1751 functions.iconify = false;
1752
1753 break;
1754 }
1755
1756 reconfigure();
1757 } 1722 }
1758 } 1723 }
1724 }
1759} 1725}
1760 1726
1761 1727
@@ -3466,6 +3432,61 @@ void FluxboxWindow::shapeEvent(XShapeEvent *) {
3466#endif // SHAPE 3432#endif // SHAPE
3467 3433
3468 3434
3435void FluxboxWindow::setDecoration(Decoration decoration) {
3436
3437 switch (decoration) {
3438 case DECOR_NONE:
3439 decorations.titlebar = decorations.border = decorations.handle =
3440 decorations.iconify = decorations.maximize =
3441 decorations.menu = decorations.tab = false; //tab is also a decor
3442 functions.resize = functions.move = functions.iconify =
3443 functions.maximize = false;
3444 break;
3445
3446 default:
3447 case DECOR_NORMAL:
3448 decorations.titlebar = decorations.border = decorations.handle =
3449 decorations.iconify = decorations.maximize =
3450 decorations.menu = true;
3451 functions.resize = functions.move = functions.iconify =
3452 functions.maximize = true;
3453 XMapSubwindows(display, frame.window);
3454 XMapWindow(display, frame.window);
3455
3456 break;
3457
3458 case DECOR_TINY:
3459 decorations.titlebar = decorations.iconify = decorations.menu =
3460 functions.move = functions.iconify = true;
3461 decorations.border = decorations.handle = decorations.maximize =
3462 functions.resize = functions.maximize = false;
3463 XMapSubwindows(display, frame.window);
3464 XMapWindow(display, frame.window);
3465 break;
3466
3467 case DECOR_TOOL:
3468 decorations.titlebar = decorations.menu = functions.move = true;
3469 decorations.iconify = decorations.border = decorations.handle =
3470 decorations.maximize = functions.resize = functions.maximize =
3471 functions.iconify = false;
3472 decorate();
3473 break;
3474 }
3475
3476 reconfigure();
3477
3478}
3479
3480void FluxboxWindow::toggleDecoration() {
3481 static bool decor = false;
3482 if (!decor) {
3483 setDecoration(DECOR_NONE);
3484 decor = true;
3485 } else {
3486 setDecoration(old_decoration);
3487 decor = false;
3488 }
3489}
3469bool FluxboxWindow::validateClient(void) { 3490bool FluxboxWindow::validateClient(void) {
3470 XSync(display, false); 3491 XSync(display, false);
3471 3492
@@ -3586,6 +3607,7 @@ void FluxboxWindow::stopResizing(Window win) {
3586 XUngrabPointer(display, CurrentTime); 3607 XUngrabPointer(display, CurrentTime);
3587} 3608}
3588 3609
3610
3589void FluxboxWindow::restore(void) { 3611void FluxboxWindow::restore(void) {
3590 XChangeSaveSet(display, client.window, SetModeDelete); 3612 XChangeSaveSet(display, client.window, SetModeDelete);
3591 XSelectInput(display, client.window, NoEventMask); 3613 XSelectInput(display, client.window, NoEventMask);
@@ -3652,45 +3674,10 @@ void FluxboxWindow::changeBlackboxHints(BaseDisplay::BlackboxHints *net) {
3652 } 3674 }
3653 3675
3654 if (net->flags & BaseDisplay::ATTRIB_DECORATION) { 3676 if (net->flags & BaseDisplay::ATTRIB_DECORATION) {
3655 switch (net->decoration) { 3677 old_decoration = static_cast<Decoration>(net->decoration);
3656 case BaseDisplay::DECOR_NONE: 3678 setDecoration(old_decoration);
3657 decorations.titlebar = decorations.border = decorations.handle =
3658 decorations.iconify = decorations.maximize =
3659 decorations.menu = decorations.tab = false; //tab is also a decor
3660 functions.resize = functions.move = functions.iconify =
3661 functions.maximize = false;
3662
3663 break;
3664
3665 default:
3666 case BaseDisplay::DECOR_NORMAL:
3667 decorations.titlebar = decorations.border = decorations.handle =
3668 decorations.iconify = decorations.maximize =
3669 decorations.menu = true;
3670 functions.resize = functions.move = functions.iconify =
3671 functions.maximize = true;
3672
3673 break;
3674
3675 case BaseDisplay::DECOR_TINY:
3676 decorations.titlebar = decorations.iconify = decorations.menu =
3677 functions.move = functions.iconify = true;
3678 decorations.border = decorations.handle = decorations.maximize =
3679 functions.resize = functions.maximize = false;
3680
3681 break;
3682
3683 case BaseDisplay::DECOR_TOOL:
3684 decorations.titlebar = decorations.menu = functions.move = true;
3685 decorations.iconify = decorations.border = decorations.handle =
3686 decorations.maximize = functions.resize = functions.maximize =
3687 functions.iconify = false;
3688
3689 break;
3690 }
3691
3692 reconfigure();
3693 } 3679 }
3680
3694} 3681}
3695 3682
3696 3683