diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.cc | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/src/Window.cc b/src/Window.cc index ec542f1..834531c 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.68 2002/08/12 17:32:52 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.69 2002/08/14 22:52:06 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -186,13 +186,13 @@ tab(0) | |||
186 | getWMHints(); | 186 | getWMHints(); |
187 | getWMNormalHints(); | 187 | getWMNormalHints(); |
188 | 188 | ||
189 | #ifdef SLIT | 189 | #ifdef SLIT |
190 | 190 | ||
191 | if (client.initial_state == WithdrawnState) { | 191 | if (client.initial_state == WithdrawnState) { |
192 | screen->getSlit()->addClient(client.window); | 192 | screen->getSlit()->addClient(client.window); |
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | #endif // SLIT | 195 | #endif // SLIT |
196 | 196 | ||
197 | managed = true; //mark for usage | 197 | managed = true; //mark for usage |
198 | 198 | ||
@@ -791,23 +791,20 @@ void FluxboxWindow::updateGnomeAtoms() const { | |||
791 | } | 791 | } |
792 | 792 | ||
793 | void FluxboxWindow::updateGnomeStateAtom() const { | 793 | void FluxboxWindow::updateGnomeStateAtom() const { |
794 | const BaseDisplay *bd = screen->getBaseDisplay(); | ||
795 | int val = getGnomeWindowState(); | 794 | int val = getGnomeWindowState(); |
796 | XChangeProperty(display, client.window, bd->getGnomeStateAtom(), | 795 | XChangeProperty(display, client.window, FbAtoms::instance()->getGnomeStateAtom(), |
797 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); | 796 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); |
798 | } | 797 | } |
799 | 798 | ||
800 | void FluxboxWindow::updateGnomeLayerAtom() const { | 799 | void FluxboxWindow::updateGnomeLayerAtom() const { |
801 | const BaseDisplay *bd = screen->getBaseDisplay(); | ||
802 | int val = getGnomeLayer(); | 800 | int val = getGnomeLayer(); |
803 | XChangeProperty(display, client.window, bd->getGnomeLayerAtom(), | 801 | XChangeProperty(display, client.window, FbAtoms::instance()->getGnomeLayerAtom(), |
804 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); | 802 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); |
805 | } | 803 | } |
806 | 804 | ||
807 | void FluxboxWindow::updateGnomeWorkspaceAtom() const { | 805 | void FluxboxWindow::updateGnomeWorkspaceAtom() const { |
808 | const BaseDisplay *bd = screen->getBaseDisplay(); | ||
809 | int val = workspace_number; | 806 | int val = workspace_number; |
810 | XChangeProperty(display, client.window, bd->getGnomeWorkspaceAtom(), | 807 | XChangeProperty(display, client.window, FbAtoms::instance()->getGnomeWorkspaceAtom(), |
811 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); | 808 | XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); |
812 | } | 809 | } |
813 | 810 | ||
@@ -850,23 +847,23 @@ int FluxboxWindow::getGnomeLayer() const { | |||
850 | } | 847 | } |
851 | 848 | ||
852 | bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { | 849 | bool FluxboxWindow::handleGnomePropertyNotify(Atom atom) { |
853 | BaseDisplay *bd = screen->getBaseDisplay(); | 850 | FbAtoms *fba = FbAtoms::instance(); |
854 | 851 | ||
855 | if (atom == bd->getGnomeStateAtom()) { | 852 | if (atom == fba->getGnomeStateAtom()) { |
856 | #ifdef DEBUG | 853 | #ifdef DEBUG |
857 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome state"<<endl; | 854 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome state"<<endl; |
858 | #endif | 855 | #endif |
859 | loadGnomeStateAtom(); | 856 | loadGnomeStateAtom(); |
860 | } else if (atom == bd->getGnomeWorkspaceAtom()) { | 857 | } else if (atom == fba->getGnomeWorkspaceAtom()) { |
861 | #ifdef DEBUG | 858 | #ifdef DEBUG |
862 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome workspace"<<endl; | 859 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome workspace"<<endl; |
863 | #endif | 860 | #endif |
864 | } else if (atom == bd->getGnomeHintsAtom()) { | 861 | } else if (atom == fba->getGnomeHintsAtom()) { |
865 | #ifdef DEBUG | 862 | #ifdef DEBUG |
866 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome hints"<<endl; | 863 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome hints"<<endl; |
867 | #endif | 864 | #endif |
868 | loadGnomeHintsAtom(); | 865 | loadGnomeHintsAtom(); |
869 | } else if (atom == bd->getGnomeLayerAtom()){ | 866 | } else if (atom == fba->getGnomeLayerAtom()){ |
870 | #ifdef DEBUG | 867 | #ifdef DEBUG |
871 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome layer"<<endl; | 868 | cerr<<__FILE__<<"("<<__LINE__<<"): gnome layer"<<endl; |
872 | #endif | 869 | #endif |
@@ -958,9 +955,9 @@ void FluxboxWindow::loadGnomeStateAtom() { | |||
958 | int fmt; | 955 | int fmt; |
959 | unsigned long nitems, bytes_after; | 956 | unsigned long nitems, bytes_after; |
960 | long flags, *data = 0; | 957 | long flags, *data = 0; |
961 | BaseDisplay *bd = screen->getBaseDisplay(); | 958 | |
962 | if (XGetWindowProperty (bd->getXDisplay(), getClientWindow(), | 959 | if (XGetWindowProperty (display, getClientWindow(), |
963 | bd->getGnomeStateAtom(), 0, 1, False, XA_CARDINAL, | 960 | FbAtoms::instance()->getGnomeStateAtom(), 0, 1, False, XA_CARDINAL, |
964 | &ret_type, &fmt, &nitems, &bytes_after, | 961 | &ret_type, &fmt, &nitems, &bytes_after, |
965 | (unsigned char **) &data) == Success && data) { | 962 | (unsigned char **) &data) == Success && data) { |
966 | flags = *data; | 963 | flags = *data; |
@@ -977,9 +974,9 @@ void FluxboxWindow::loadGnomeHintsAtom() { | |||
977 | int fmt; | 974 | int fmt; |
978 | unsigned long nitems, bytes_after; | 975 | unsigned long nitems, bytes_after; |
979 | long *data = 0; | 976 | long *data = 0; |
980 | BaseDisplay *bd = screen->getBaseDisplay(); | 977 | |
981 | if (XGetWindowProperty (bd->getXDisplay(), getClientWindow(), | 978 | if (XGetWindowProperty (display, getClientWindow(), |
982 | bd->getGnomeHintsAtom(), 0, 1, False, XA_CARDINAL, | 979 | FbAtoms::instance()->getGnomeHintsAtom(), 0, 1, False, XA_CARDINAL, |
983 | &ret_type, &fmt, &nitems, &bytes_after, | 980 | &ret_type, &fmt, &nitems, &bytes_after, |
984 | (unsigned char **) &data) == Success && data) { | 981 | (unsigned char **) &data) == Success && data) { |
985 | gnome_hints = static_cast<int>(*data); | 982 | gnome_hints = static_cast<int>(*data); |
@@ -997,9 +994,9 @@ void FluxboxWindow::loadGnomeLayerAtom() { | |||
997 | int fmt; | 994 | int fmt; |
998 | unsigned long nitems, bytes_after; | 995 | unsigned long nitems, bytes_after; |
999 | long *data = 0; | 996 | long *data = 0; |
1000 | BaseDisplay *bd = screen->getBaseDisplay(); | 997 | |
1001 | if (XGetWindowProperty (bd->getXDisplay(), getClientWindow(), | 998 | if (XGetWindowProperty (display, getClientWindow(), |
1002 | bd->getGnomeLayerAtom(), 0, 1, False, XA_CARDINAL, | 999 | FbAtoms::instance()->getGnomeLayerAtom(), 0, 1, False, XA_CARDINAL, |
1003 | &ret_type, &fmt, &nitems, &bytes_after, | 1000 | &ret_type, &fmt, &nitems, &bytes_after, |
1004 | (unsigned char **) &data) == Success && data) { | 1001 | (unsigned char **) &data) == Success && data) { |
1005 | setGnomeLayer(static_cast<int>(*data)); | 1002 | setGnomeLayer(static_cast<int>(*data)); |
@@ -1659,16 +1656,19 @@ void FluxboxWindow::getBlackboxHints() { | |||
1659 | 1656 | ||
1660 | 1657 | ||
1661 | void FluxboxWindow::configure(int dx, int dy, | 1658 | void FluxboxWindow::configure(int dx, int dy, |
1662 | unsigned int dw, unsigned int dh) { | 1659 | unsigned int dw, unsigned int dh) { |
1660 | |||
1663 | //we don't want negative size | 1661 | //we don't want negative size |
1664 | if (dw <0 || dh<0) | 1662 | if (dw < 0 || dh < 0) |
1665 | return; | 1663 | return; |
1666 | 1664 | ||
1667 | bool send_event = (frame.x != dx || frame.y != dy); | 1665 | bool send_event = (frame.x != dx || frame.y != dy); |
1668 | 1666 | ||
1669 | if ((dw != frame.width) || (dh != frame.height)) { | 1667 | if ((dw != frame.width) || (dh != frame.height)) { |
1670 | if ((((signed) frame.width) + dx) < 0) dx = 0; | 1668 | if ((((signed) frame.width) + dx) < 0) |
1671 | if ((((signed) frame.height) + dy) < 0) dy = 0; | 1669 | dx = 0; |
1670 | if ((((signed) frame.height) + dy) < 0) | ||
1671 | dy = 0; | ||
1672 | 1672 | ||
1673 | frame.x = dx; | 1673 | frame.x = dx; |
1674 | frame.y = dy; | 1674 | frame.y = dy; |
@@ -1748,10 +1748,11 @@ void FluxboxWindow::configure(int dx, int dy, | |||
1748 | 1748 | ||
1749 | 1749 | ||
1750 | bool FluxboxWindow::setInputFocus() { | 1750 | bool FluxboxWindow::setInputFocus() { |
1751 | #ifdef GNOME | 1751 | #ifdef GNOME |
1752 | if (gnome_hints & WIN_HINTS_SKIP_FOCUS) | 1752 | if (gnome_hints & WIN_HINTS_SKIP_FOCUS) |
1753 | return false; | 1753 | return false; |
1754 | #endif | 1754 | #endif // GNOME |
1755 | |||
1755 | if (((signed) (frame.x + frame.width)) < 0) { | 1756 | if (((signed) (frame.x + frame.width)) < 0) { |
1756 | if (((signed) (frame.y + frame.y_border)) < 0) | 1757 | if (((signed) (frame.y + frame.y_border)) < 0) |
1757 | configure(screen->getBorderWidth(), screen->getBorderWidth(), | 1758 | configure(screen->getBorderWidth(), screen->getBorderWidth(), |
@@ -1786,10 +1787,10 @@ bool FluxboxWindow::setInputFocus() { | |||
1786 | return client.transient->setInputFocus(); | 1787 | return client.transient->setInputFocus(); |
1787 | else { | 1788 | else { |
1788 | if (! focused) { | 1789 | if (! focused) { |
1789 | if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) | 1790 | if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) { |
1790 | XSetInputFocus(display, client.window, | 1791 | XSetInputFocus(display, client.window, |
1791 | RevertToPointerRoot, CurrentTime); | 1792 | RevertToPointerRoot, CurrentTime); |
1792 | else | 1793 | } else |
1793 | return false; | 1794 | return false; |
1794 | 1795 | ||
1795 | fluxbox->setFocusedWindow(this); | 1796 | fluxbox->setFocusedWindow(this); |