diff options
author | fluxgen <fluxgen> | 2003-04-15 18:55:33 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-15 18:55:33 (GMT) |
commit | 5e9d9bbed51a00f07e4aaf0b194b8574f0fa596b (patch) | |
tree | 34a2e3359b7e3b054ccdefb0680508ae6a94dcf4 | |
parent | 175b63c7f916b752bf102f0207eeff9a569cce38 (diff) | |
download | fluxbox-5e9d9bbed51a00f07e4aaf0b194b8574f0fa596b.zip fluxbox-5e9d9bbed51a00f07e4aaf0b194b8574f0fa596b.tar.bz2 |
send notification when we get configureNotify
-rw-r--r-- | src/Window.cc | 107 |
1 files changed, 67 insertions, 40 deletions
diff --git a/src/Window.cc b/src/Window.cc index ec82bd5..19446d9 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.135 2003/04/15 14:40:24 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.136 2003/04/15 18:55:33 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -457,8 +457,8 @@ void FluxboxWindow::init() { | |||
457 | } | 457 | } |
458 | 458 | ||
459 | setState(current_state); | 459 | setState(current_state); |
460 | m_frame.resizeForClient(wattrib.width, wattrib.height); | 460 | // m_frame.resizeForClient(wattrib.width, wattrib.height); |
461 | 461 | m_frame.reconfigure(); | |
462 | // no focus default | 462 | // no focus default |
463 | setFocusFlag(false); | 463 | setFocusFlag(false); |
464 | 464 | ||
@@ -482,8 +482,13 @@ void FluxboxWindow::attachClient(WinClient &client) { | |||
482 | ClientList::iterator client_it_end = old_win->clientList().end(); | 482 | ClientList::iterator client_it_end = old_win->clientList().end(); |
483 | for (; client_it != client_it_end; ++client_it) { | 483 | for (; client_it != client_it_end; ++client_it) { |
484 | fb->saveWindowSearch((*client_it)->window(), this); | 484 | fb->saveWindowSearch((*client_it)->window(), this); |
485 | |||
485 | // reparent window to this | 486 | // reparent window to this |
486 | m_frame.setClientWindow(*(*client_it)); | 487 | m_frame.setClientWindow(**client_it); |
488 | resizeClient(**client_it, | ||
489 | m_frame.clientArea().width(), | ||
490 | m_frame.clientArea().height()); | ||
491 | |||
487 | (*client_it)->m_win = this; | 492 | (*client_it)->m_win = this; |
488 | // create a labelbutton for this client and | 493 | // create a labelbutton for this client and |
489 | // associate it with the pointer | 494 | // associate it with the pointer |
@@ -1057,40 +1062,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y, | |||
1057 | } | 1062 | } |
1058 | 1063 | ||
1059 | if (send_event && ! moving) { | 1064 | if (send_event && ! moving) { |
1060 | ClientList::iterator client_it = m_clientlist.begin(); | 1065 | sendConfigureNotify(); |
1061 | ClientList::iterator client_it_end = m_clientlist.end(); | ||
1062 | for (; client_it != client_it_end; ++client_it) { | ||
1063 | WinClient &client = *(*client_it); | ||
1064 | /* | ||
1065 | Send event telling where the root position | ||
1066 | of the client window is. (ie frame pos + client pos inside the frame = send pos) | ||
1067 | */ | ||
1068 | //!! | ||
1069 | client.x = m_frame.x(); | ||
1070 | client.y = m_frame.y(); | ||
1071 | client.resize(m_frame.clientArea().width(), | ||
1072 | m_frame.clientArea().height()); | ||
1073 | client.updateRect(m_frame.x() + m_frame.clientArea().x(), | ||
1074 | m_frame.y() + m_frame.clientArea().y(), | ||
1075 | m_frame.clientArea().width(), | ||
1076 | m_frame.clientArea().height()); | ||
1077 | |||
1078 | XEvent event; | ||
1079 | event.type = ConfigureNotify; | ||
1080 | |||
1081 | event.xconfigure.display = display; | ||
1082 | event.xconfigure.event = client.window(); | ||
1083 | event.xconfigure.window = client.window(); | ||
1084 | event.xconfigure.x = m_frame.x() + m_frame.clientArea().x(); | ||
1085 | event.xconfigure.y = m_frame.y() + m_frame.clientArea().y(); | ||
1086 | event.xconfigure.width = client.width(); | ||
1087 | event.xconfigure.height = client.height(); | ||
1088 | event.xconfigure.border_width = client.old_bw; | ||
1089 | event.xconfigure.above = m_frame.window().window(); | ||
1090 | event.xconfigure.override_redirect = false; | ||
1091 | |||
1092 | screen.updateNetizenConfigNotify(&event); | ||
1093 | } // end for | ||
1094 | } | 1066 | } |
1095 | } | 1067 | } |
1096 | 1068 | ||
@@ -2139,11 +2111,21 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { | |||
2139 | ch = cr.height; | 2111 | ch = cr.height; |
2140 | 2112 | ||
2141 | 2113 | ||
2114 | bool send_notify = false; | ||
2142 | // the request is for client window so we resize the frame to it first | 2115 | // the request is for client window so we resize the frame to it first |
2143 | if (frame().width() != cw || frame().height() != ch) | 2116 | if (frame().width() != cw || frame().height() != ch) { |
2144 | frame().resizeForClient(cw, ch); | 2117 | frame().resizeForClient(cw, ch); |
2145 | if (frame().x() != cx || frame().y() != cy) | 2118 | send_notify = true; |
2119 | } | ||
2120 | |||
2121 | if (frame().x() != cx || frame().y() != cy) { | ||
2146 | move(cx, cy); | 2122 | move(cx, cy); |
2123 | // since we already send a notify in move we don't need to do that again | ||
2124 | send_notify = false; | ||
2125 | } | ||
2126 | |||
2127 | if (send_notify) | ||
2128 | sendConfigureNotify(); | ||
2147 | 2129 | ||
2148 | if (cr.value_mask & CWStackMode) { | 2130 | if (cr.value_mask & CWStackMode) { |
2149 | switch (cr.detail) { | 2131 | switch (cr.detail) { |
@@ -2991,3 +2973,48 @@ void FluxboxWindow::left_fixsize(int *gx, int *gy) { | |||
2991 | last_resize_h = dy; | 2973 | last_resize_h = dy; |
2992 | last_resize_x = m_frame.x() + m_frame.width() - last_resize_w; | 2974 | last_resize_x = m_frame.x() + m_frame.width() - last_resize_w; |
2993 | } | 2975 | } |
2976 | |||
2977 | void FluxboxWindow::resizeClient(WinClient &client, | ||
2978 | unsigned int height, unsigned int width) { | ||
2979 | client.resize(m_frame.clientArea().width(), | ||
2980 | m_frame.clientArea().height()); | ||
2981 | client.updateRect(m_frame.x() + m_frame.clientArea().x(), | ||
2982 | m_frame.y() + m_frame.clientArea().y(), | ||
2983 | m_frame.clientArea().width(), | ||
2984 | m_frame.clientArea().height()); | ||
2985 | } | ||
2986 | |||
2987 | void FluxboxWindow::sendConfigureNotify() { | ||
2988 | ClientList::iterator client_it = m_clientlist.begin(); | ||
2989 | ClientList::iterator client_it_end = m_clientlist.end(); | ||
2990 | for (; client_it != client_it_end; ++client_it) { | ||
2991 | WinClient &client = *(*client_it); | ||
2992 | /* | ||
2993 | Send event telling where the root position | ||
2994 | of the client window is. (ie frame pos + client pos inside the frame = send pos) | ||
2995 | */ | ||
2996 | //!! | ||
2997 | client.x = m_frame.x(); | ||
2998 | client.y = m_frame.y(); | ||
2999 | resizeClient(client, | ||
3000 | m_frame.clientArea().width(), | ||
3001 | m_frame.clientArea().height()); | ||
3002 | |||
3003 | |||
3004 | XEvent event; | ||
3005 | event.type = ConfigureNotify; | ||
3006 | |||
3007 | event.xconfigure.display = display; | ||
3008 | event.xconfigure.event = client.window(); | ||
3009 | event.xconfigure.window = client.window(); | ||
3010 | event.xconfigure.x = m_frame.x() + m_frame.clientArea().x(); | ||
3011 | event.xconfigure.y = m_frame.y() + m_frame.clientArea().y(); | ||
3012 | event.xconfigure.width = client.width(); | ||
3013 | event.xconfigure.height = client.height(); | ||
3014 | event.xconfigure.border_width = client.old_bw; | ||
3015 | event.xconfigure.above = m_frame.window().window(); | ||
3016 | event.xconfigure.override_redirect = false; | ||
3017 | |||
3018 | screen.updateNetizenConfigNotify(&event); | ||
3019 | } // end for | ||
3020 | } | ||