diff options
author | rathnor <rathnor> | 2003-09-24 14:02:25 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-09-24 14:02:25 (GMT) |
commit | feb7462e381b4015bc736e90da87dc7cc5711b1a (patch) | |
tree | e028335ecbc02b1e79128247293003b2ce5afc29 /src | |
parent | bec4f7c894677a92d9210a1b1e511afd4cee5e5e (diff) | |
download | fluxbox-feb7462e381b4015bc736e90da87dc7cc5711b1a.zip fluxbox-feb7462e381b4015bc736e90da87dc7cc5711b1a.tar.bz2 |
Fix updates to mwm_hints, and make configure request move and resize atomic
Diffstat (limited to 'src')
-rw-r--r-- | src/FbAtoms.cc | 4 | ||||
-rw-r--r-- | src/FbAtoms.hh | 6 | ||||
-rw-r--r-- | src/FbWinFrame.cc | 85 | ||||
-rw-r--r-- | src/FbWinFrame.hh | 9 | ||||
-rw-r--r-- | src/WinClient.cc | 4 | ||||
-rw-r--r-- | src/Window.cc | 112 | ||||
-rw-r--r-- | src/Window.hh | 12 |
7 files changed, 126 insertions, 106 deletions
diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc index 0271a56..de8a9a8 100644 --- a/src/FbAtoms.cc +++ b/src/FbAtoms.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: FbAtoms.cc,v 1.8 2003/05/13 11:47:29 fluxgen Exp $ | 22 | // $Id: FbAtoms.cc,v 1.9 2003/09/24 14:02:25 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbAtoms.hh" | 24 | #include "FbAtoms.hh" |
25 | #include "App.hh" | 25 | #include "App.hh" |
@@ -46,7 +46,6 @@ FbAtoms::~FbAtoms() { | |||
46 | FbAtoms *FbAtoms::instance() { | 46 | FbAtoms *FbAtoms::instance() { |
47 | if (s_singleton == 0) | 47 | if (s_singleton == 0) |
48 | throw string("Create one instance of FbAtoms first!"); | 48 | throw string("Create one instance of FbAtoms first!"); |
49 | |||
50 | return s_singleton; | 49 | return s_singleton; |
51 | } | 50 | } |
52 | 51 | ||
@@ -60,6 +59,7 @@ void FbAtoms::initAtoms() { | |||
60 | xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); | 59 | xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); |
61 | xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); | 60 | xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); |
62 | xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); | 61 | xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); |
62 | motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); | ||
63 | 63 | ||
64 | blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); | 64 | blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); |
65 | blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); | 65 | blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); |
diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh index 2b4898c..3af1f31 100644 --- a/src/FbAtoms.hh +++ b/src/FbAtoms.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: FbAtoms.hh,v 1.10 2003/04/26 18:56:02 fluxgen Exp $ | 22 | // $Id: FbAtoms.hh,v 1.11 2003/09/24 14:02:25 rathnor Exp $ |
23 | #ifndef FBATOMS_HH | 23 | #ifndef FBATOMS_HH |
24 | #define FBATOMS_HH | 24 | #define FBATOMS_HH |
25 | 25 | ||
@@ -34,7 +34,6 @@ public: | |||
34 | 34 | ||
35 | static FbAtoms *instance(); | 35 | static FbAtoms *instance(); |
36 | 36 | ||
37 | |||
38 | inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; } | 37 | inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; } |
39 | inline Atom getWMStateAtom() const { return xa_wm_state; } | 38 | inline Atom getWMStateAtom() const { return xa_wm_state; } |
40 | inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; } | 39 | inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; } |
@@ -44,6 +43,7 @@ public: | |||
44 | // this atom is for normal app->WM hints about decorations, stacking, | 43 | // this atom is for normal app->WM hints about decorations, stacking, |
45 | // starting workspace etc... | 44 | // starting workspace etc... |
46 | inline Atom getFluxboxHintsAtom() const { return blackbox_hints;} | 45 | inline Atom getFluxboxHintsAtom() const { return blackbox_hints;} |
46 | inline Atom getMWMHintsAtom() const { return motif_wm_hints; } | ||
47 | 47 | ||
48 | // these atoms are for normal app->WM interaction beyond the scope of the | 48 | // these atoms are for normal app->WM interaction beyond the scope of the |
49 | // ICCCM... | 49 | // ICCCM... |
@@ -78,6 +78,8 @@ private: | |||
78 | // NETAttributes | 78 | // NETAttributes |
79 | Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; | 79 | Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; |
80 | 80 | ||
81 | Atom motif_wm_hints; | ||
82 | |||
81 | // NETStructureMessages | 83 | // NETStructureMessages |
82 | Atom blackbox_structure_messages, blackbox_notify_startup, | 84 | Atom blackbox_structure_messages, blackbox_notify_startup, |
83 | blackbox_notify_window_add, blackbox_notify_window_del, | 85 | blackbox_notify_window_add, blackbox_notify_window_del, |
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 1781fcd..fb309b4 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.53 2003/09/16 13:11:41 rathnor Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.54 2003/09/24 14:02:25 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -163,53 +163,66 @@ void FbWinFrame::shade() { | |||
163 | 163 | ||
164 | 164 | ||
165 | void FbWinFrame::move(int x, int y) { | 165 | void FbWinFrame::move(int x, int y) { |
166 | // don't update unless we really changes position | 166 | moveResize(x, y, 0, 0, true, false); |
167 | if (x == window().x() && y == window().y()) | 167 | } |
168 | return; | ||
169 | 168 | ||
170 | window().move(x, y); | 169 | void FbWinFrame::resize(unsigned int width, unsigned int height) { |
171 | // update transparent only if we need to | 170 | moveResize(0, 0, width, height, false, true); |
172 | if (theme().alpha() == 255) | 171 | } |
173 | return; | ||
174 | 172 | ||
175 | // restart update timer | 173 | // need an atomic moveresize where possible |
176 | m_update_timer.start(); | 174 | void FbWinFrame::moveResizeForClient(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) { |
175 | // total height for frame | ||
177 | 176 | ||
178 | /* | 177 | unsigned int total_height = height; |
179 | 178 | ||
180 | */ | 179 | if (resize) { |
180 | // having a titlebar = 1 extra border + titlebar height | ||
181 | if (m_use_titlebar) | ||
182 | total_height += m_titlebar.height() + m_titlebar.borderWidth(); | ||
183 | // having a handle = 1 extra border + handle height | ||
184 | if (m_use_handle) | ||
185 | total_height += m_handle.height() + m_handle.borderWidth(); | ||
186 | } | ||
187 | moveResize(x, y, width, total_height, move, resize); | ||
181 | } | 188 | } |
182 | 189 | ||
183 | void FbWinFrame::resize(unsigned int width, unsigned int height) { | 190 | void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { |
184 | // update unshaded size if we're in shaded state and just resize width | 191 | moveResizeForClient(0, 0, width, height, false, true); |
185 | if (m_shaded) { | 192 | } |
193 | |||
194 | void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height, bool move, bool resize) { | ||
195 | if (move && x == window().x() && y == window().y()) | ||
196 | move = false; | ||
197 | |||
198 | if (resize && width == FbWinFrame::width() && height == FbWinFrame::height()) | ||
199 | resize = false; | ||
200 | |||
201 | if (!move && !resize) | ||
202 | return; | ||
203 | |||
204 | if (resize && m_shaded) { | ||
205 | // update unshaded size if we're in shaded state and just resize width | ||
186 | m_width_before_shade = width; | 206 | m_width_before_shade = width; |
187 | m_height_before_shade = height; | 207 | m_height_before_shade = height; |
188 | m_window.resize(width, m_window.height()); | 208 | height = m_window.height(); |
209 | } | ||
210 | |||
211 | if (move && resize) { | ||
212 | m_window.moveResize(x, y, width, height); | ||
213 | } else if (move) { | ||
214 | m_window.move(x, y); | ||
215 | // this stuff will be caught by reconfigure if resized | ||
216 | if (theme().alpha() != 255) { | ||
217 | // restart update timer | ||
218 | m_update_timer.start(); | ||
219 | } | ||
189 | } else { | 220 | } else { |
190 | m_window.resize(width, height); | 221 | m_window.resize(width, height); |
191 | } | 222 | } |
192 | 223 | ||
193 | reconfigure(); | 224 | if (resize) |
194 | } | 225 | reconfigure(); |
195 | |||
196 | void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { | ||
197 | // total height for frame | ||
198 | unsigned int total_height = height; | ||
199 | |||
200 | // having a titlebar = 1 extra border + titlebar height | ||
201 | if (m_use_titlebar) | ||
202 | total_height += m_titlebar.height() + m_titlebar.borderWidth(); | ||
203 | // having a handle = 1 extra border + handle height | ||
204 | if (m_use_handle) | ||
205 | total_height += m_handle.height() + m_handle.borderWidth(); | ||
206 | resize(width, total_height); | ||
207 | } | ||
208 | |||
209 | void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int height) { | ||
210 | move(x, y); | ||
211 | if (width != FbWinFrame::width() || height != FbWinFrame::height()) | ||
212 | resize(width, height); | ||
213 | } | 226 | } |
214 | 227 | ||
215 | void FbWinFrame::setFocus(bool newvalue) { | 228 | void FbWinFrame::setFocus(bool newvalue) { |
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 23b004b..f57ce32 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.20 2003/09/14 10:32:31 fluxgen Exp $ | 22 | // $Id: FbWinFrame.hh,v 1.21 2003/09/24 14:02:25 rathnor Exp $ |
23 | 23 | ||
24 | #ifndef FBWINFRAME_HH | 24 | #ifndef FBWINFRAME_HH |
25 | #define FBWINFRAME_HH | 25 | #define FBWINFRAME_HH |
@@ -80,7 +80,12 @@ public: | |||
80 | void resize(unsigned int width, unsigned int height); | 80 | void resize(unsigned int width, unsigned int height); |
81 | /// resize client to specified size and resize frame to it | 81 | /// resize client to specified size and resize frame to it |
82 | void resizeForClient(unsigned int width, unsigned int height); | 82 | void resizeForClient(unsigned int width, unsigned int height); |
83 | void moveResize(int x, int y, unsigned int width, unsigned int height); | 83 | |
84 | // for when there needs to be an atomic move+resize operation | ||
85 | void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, bool move = true, bool resize = true); | ||
86 | |||
87 | // can elect to ignore move or resize (mainly for use of move/resize individual functions | ||
88 | void moveResize(int x, int y, unsigned int width, unsigned int height, bool move = true, bool resize = true); | ||
84 | 89 | ||
85 | /// set focus/unfocus style | 90 | /// set focus/unfocus style |
86 | void setFocus(bool newvalue); | 91 | void setFocus(bool newvalue); |
diff --git a/src/WinClient.cc b/src/WinClient.cc index 1c7b249..614b7a4 100644 --- a/src/WinClient.cc +++ b/src/WinClient.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: WinClient.cc,v 1.26 2003/09/21 13:24:27 rathnor Exp $ | 22 | // $Id: WinClient.cc,v 1.27 2003/09/24 14:02:25 rathnor Exp $ |
23 | 23 | ||
24 | #include "WinClient.hh" | 24 | #include "WinClient.hh" |
25 | 25 | ||
@@ -356,12 +356,12 @@ void WinClient::updateMWMHints() { | |||
356 | int format; | 356 | int format; |
357 | Atom atom_return; | 357 | Atom atom_return; |
358 | unsigned long num = 0, len = 0; | 358 | unsigned long num = 0, len = 0; |
359 | Atom motif_wm_hints = XInternAtom(FbTk::App::instance()->display(), "_MOTIF_WM_HINTS", False); | ||
360 | 359 | ||
361 | if (m_mwm_hint) { | 360 | if (m_mwm_hint) { |
362 | XFree(m_mwm_hint); | 361 | XFree(m_mwm_hint); |
363 | m_mwm_hint = 0; | 362 | m_mwm_hint = 0; |
364 | } | 363 | } |
364 | Atom motif_wm_hints = FbAtoms::instance()->getMWMHintsAtom(); | ||
365 | 365 | ||
366 | if (!(property(motif_wm_hints, 0, | 366 | if (!(property(motif_wm_hints, 0, |
367 | PropMwmHintsElements, false, | 367 | PropMwmHintsElements, false, |
diff --git a/src/Window.cc b/src/Window.cc index 5d2f600..f35c21e 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.233 2003/09/24 11:33:40 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.234 2003/09/24 14:02:25 rathnor Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -415,9 +415,9 @@ void FluxboxWindow::init() { | |||
415 | decorations.close = false; | 415 | decorations.close = false; |
416 | 416 | ||
417 | if (m_client->getBlackboxHint() != 0) | 417 | if (m_client->getBlackboxHint() != 0) |
418 | getBlackboxHints(); | 418 | updateBlackboxHintsFromClient(*m_client); |
419 | else | 419 | else |
420 | getMWMHints(); | 420 | updateMWMHintsFromClient(*m_client); |
421 | 421 | ||
422 | //!! | 422 | //!! |
423 | // fetch client size and placement | 423 | // fetch client size and placement |
@@ -498,8 +498,7 @@ void FluxboxWindow::init() { | |||
498 | 498 | ||
499 | } | 499 | } |
500 | 500 | ||
501 | frame().move(wattrib.x, wattrib.y); | 501 | frame().moveResizeForClient(wattrib.x, wattrib.y, wattrib.width, wattrib.height); |
502 | frame().resizeForClient(wattrib.width, wattrib.height); | ||
503 | 502 | ||
504 | // if we're a transient then we should be on the same layer as our parent | 503 | // if we're a transient then we should be on the same layer as our parent |
505 | if (m_client->isTransient() && | 504 | if (m_client->isTransient() && |
@@ -907,8 +906,8 @@ bool FluxboxWindow::isGroupable() const { | |||
907 | 906 | ||
908 | void FluxboxWindow::associateClientWindow() { | 907 | void FluxboxWindow::associateClientWindow() { |
909 | m_client->setBorderWidth(0); | 908 | m_client->setBorderWidth(0); |
910 | updateTitleFromClient(); | 909 | updateTitleFromClient(*m_client); |
911 | updateIconNameFromClient(); | 910 | updateIconNameFromClient(*m_client); |
912 | 911 | ||
913 | frame().setClientWindow(*m_client); | 912 | frame().setClientWindow(*m_client); |
914 | frame().resizeForClient(m_client->width(), m_client->height()); | 913 | frame().resizeForClient(m_client->width(), m_client->height()); |
@@ -964,25 +963,24 @@ void FluxboxWindow::reconfigure() { | |||
964 | } | 963 | } |
965 | 964 | ||
966 | /// update current client title and title in our frame | 965 | /// update current client title and title in our frame |
967 | void FluxboxWindow::updateTitleFromClient() { | 966 | void FluxboxWindow::updateTitleFromClient(WinClient &client) { |
968 | m_client->updateTitle(); | 967 | client.updateTitle(); |
969 | // compare old title with new and see if we need to update | 968 | // compare old title with new and see if we need to update |
970 | // graphics | 969 | // graphics |
971 | if (m_labelbuttons[m_client]->text() != m_client->title()) { | 970 | if (m_labelbuttons[&client]->text() != client.title()) { |
972 | m_labelbuttons[m_client]->setText(m_client->title()); | 971 | m_labelbuttons[&client]->setText(client.title()); |
973 | m_labelbuttons[m_client]->clear(); // redraw text | 972 | m_labelbuttons[&client]->clear(); // redraw text |
974 | m_labelbuttons[m_client]->updateTransparent(); | 973 | m_labelbuttons[&client]->updateTransparent(); |
975 | } | 974 | } |
976 | } | 975 | } |
977 | 976 | ||
978 | /// update icon title from client | 977 | /// update icon title from client |
979 | void FluxboxWindow::updateIconNameFromClient() { | 978 | void FluxboxWindow::updateIconNameFromClient(WinClient &client) { |
980 | m_client->updateIconTitle(); | 979 | client.updateIconTitle(); |
981 | } | 980 | } |
982 | 981 | ||
983 | 982 | void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) { | |
984 | void FluxboxWindow::getMWMHints() { | 983 | const WinClient::MwmHints *hint = client.getMwmHint(); |
985 | const WinClient::MwmHints *hint = m_client->getMwmHint(); | ||
986 | 984 | ||
987 | if (!hint) return; | 985 | if (!hint) return; |
988 | 986 | ||
@@ -1049,8 +1047,8 @@ void FluxboxWindow::updateFunctions() { | |||
1049 | setupWindow(); | 1047 | setupWindow(); |
1050 | } | 1048 | } |
1051 | 1049 | ||
1052 | void FluxboxWindow::getBlackboxHints() { | 1050 | void FluxboxWindow::updateBlackboxHintsFromClient(WinClient &client) { |
1053 | const FluxboxWindow::BlackboxHints *hint = m_client->getBlackboxHint(); | 1051 | const FluxboxWindow::BlackboxHints *hint = client.getBlackboxHint(); |
1054 | if (!hint) return; | 1052 | if (!hint) return; |
1055 | 1053 | ||
1056 | if (hint->flags & ATTRIB_SHADED) | 1054 | if (hint->flags & ATTRIB_SHADED) |
@@ -1912,10 +1910,12 @@ void FluxboxWindow::handleEvent(XEvent &event) { | |||
1912 | // case MapRequest: | 1910 | // case MapRequest: |
1913 | // mapRequestEvent(event.xmaprequest); | 1911 | // mapRequestEvent(event.xmaprequest); |
1914 | //break; | 1912 | //break; |
1915 | case PropertyNotify: | 1913 | case PropertyNotify: { |
1916 | if (event.xproperty.state != PropertyDelete) { | 1914 | WinClient *client = findClient(event.xproperty.window); |
1917 | propertyNotifyEvent(event.xproperty.atom); | 1915 | if (client) { |
1916 | propertyNotifyEvent(*client, event.xproperty.atom); | ||
1918 | } | 1917 | } |
1918 | } | ||
1919 | break; | 1919 | break; |
1920 | 1920 | ||
1921 | default: | 1921 | default: |
@@ -2076,8 +2076,7 @@ void FluxboxWindow::destroyNotifyEvent(XDestroyWindowEvent &de) { | |||
2076 | } | 2076 | } |
2077 | 2077 | ||
2078 | 2078 | ||
2079 | void FluxboxWindow::propertyNotifyEvent(Atom atom) { | 2079 | void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) { |
2080 | |||
2081 | switch(atom) { | 2080 | switch(atom) { |
2082 | case XA_WM_CLASS: | 2081 | case XA_WM_CLASS: |
2083 | case XA_WM_CLIENT_MACHINE: | 2082 | case XA_WM_CLIENT_MACHINE: |
@@ -2085,31 +2084,28 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) { | |||
2085 | break; | 2084 | break; |
2086 | 2085 | ||
2087 | case XA_WM_TRANSIENT_FOR: { | 2086 | case XA_WM_TRANSIENT_FOR: { |
2088 | // TODO: this property notify should be handled by winclient | 2087 | bool was_transient = client.isTransient(); |
2089 | // but for now we'll justhave to update all transient info | 2088 | client.updateTransientInfo(); |
2090 | //bool was_transient = isTransient(); | ||
2091 | for_each(clientList().begin(), clientList().end(), | ||
2092 | mem_fun(&WinClient::updateTransientInfo)); | ||
2093 | reconfigure(); | ||
2094 | // TODO: this is broken whilst we don't know which client | ||
2095 | // update our layer to be the same layer as our transient for | 2089 | // update our layer to be the same layer as our transient for |
2096 | //if (isTransient() && isTransient() != was_transient) | 2090 | if (client.isTransient() && !was_transient |
2097 | // layerItem().setLayer(getTransientFor()->layerItem().getLayer()); | 2091 | && client.transientFor()->fbwindow()) |
2092 | layerItem().setLayer(client.transientFor()->fbwindow()->layerItem().getLayer()); | ||
2098 | 2093 | ||
2099 | } break; | 2094 | } break; |
2100 | 2095 | ||
2101 | case XA_WM_HINTS: | 2096 | case XA_WM_HINTS: |
2102 | m_client->updateWMHints(); | 2097 | client.updateWMHints(); |
2103 | hintSig().notify(); // notify listeners | 2098 | hintSig().notify(); // notify listeners |
2104 | break; | 2099 | break; |
2105 | 2100 | ||
2106 | case XA_WM_ICON_NAME: | 2101 | case XA_WM_ICON_NAME: |
2107 | updateIconNameFromClient(); | 2102 | client.updateIconTitle(); |
2103 | updateIconNameFromClient(client); | ||
2108 | updateIcon(); | 2104 | updateIcon(); |
2109 | break; | 2105 | break; |
2110 | 2106 | ||
2111 | case XA_WM_NAME: | 2107 | case XA_WM_NAME: |
2112 | updateTitleFromClient(); | 2108 | updateTitleFromClient(client); |
2113 | 2109 | ||
2114 | if (! iconic) | 2110 | if (! iconic) |
2115 | screen().getWorkspace(m_workspace_number)->update(); | 2111 | screen().getWorkspace(m_workspace_number)->update(); |
@@ -2120,27 +2116,27 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) { | |||
2120 | break; | 2116 | break; |
2121 | 2117 | ||
2122 | case XA_WM_NORMAL_HINTS: { | 2118 | case XA_WM_NORMAL_HINTS: { |
2123 | m_client->updateWMNormalHints(); | 2119 | client.updateWMNormalHints(); |
2124 | 2120 | ||
2125 | if ((m_client->normal_hint_flags & PMinSize) && | 2121 | if ((client.normal_hint_flags & PMinSize) && |
2126 | (m_client->normal_hint_flags & PMaxSize)) { | 2122 | (client.normal_hint_flags & PMaxSize)) { |
2127 | 2123 | ||
2128 | if (m_client->max_width != 0 && m_client->max_width <= m_client->min_width && | 2124 | if (client.max_width != 0 && client.max_width <= client.min_width && |
2129 | m_client->max_height != 0 && m_client->max_height <= m_client->min_height) { | 2125 | client.max_height != 0 && client.max_height <= client.min_height) { |
2130 | decorations.maximize = false; | 2126 | decorations.maximize = false; |
2131 | decorations.handle = false; | 2127 | decorations.handle = false; |
2132 | functions.resize=false; | 2128 | functions.resize=false; |
2133 | functions.maximize=false; | 2129 | functions.maximize=false; |
2134 | } else { | 2130 | } else { |
2135 | // TODO: is broken while handled by FbW, needs to be in WinClient | 2131 | // TODO: is broken while handled by FbW, needs to be in WinClient |
2136 | if (! winClient().isTransient()) { | 2132 | if (! client.isTransient()) { |
2137 | decorations.maximize = true; | 2133 | decorations.maximize = true; |
2138 | decorations.handle = true; | 2134 | decorations.handle = true; |
2139 | functions.maximize = true; | 2135 | functions.maximize = true; |
2140 | } | 2136 | } |
2141 | functions.resize = true; | 2137 | functions.resize = true; |
2142 | } | 2138 | } |
2143 | 2139 | setupWindow(); | |
2144 | } | 2140 | } |
2145 | 2141 | ||
2146 | // save old values | 2142 | // save old values |
@@ -2159,13 +2155,16 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) { | |||
2159 | } | 2155 | } |
2160 | 2156 | ||
2161 | default: | 2157 | default: |
2162 | if (atom == FbAtoms::instance()->getWMProtocolsAtom()) { | 2158 | FbAtoms *fbatoms = FbAtoms::instance(); |
2163 | m_client->updateWMProtocols(); | 2159 | if (atom == fbatoms->getWMProtocolsAtom()) { |
2164 | //!!TODO check this area | 2160 | client.updateWMProtocols(); |
2165 | // reset window actions | 2161 | } else if (atom == fbatoms->getMWMHintsAtom()) { |
2166 | setupWindow(); | 2162 | client.updateMWMHints(); |
2167 | 2163 | updateMWMHintsFromClient(client); | |
2168 | } | 2164 | } else if (atom == fbatoms->getFluxboxHintsAtom()) { |
2165 | client.updateBlackboxHints(); | ||
2166 | updateBlackboxHintsFromClient(client); | ||
2167 | } | ||
2169 | break; | 2168 | break; |
2170 | } | 2169 | } |
2171 | 2170 | ||
@@ -2208,11 +2207,12 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { | |||
2208 | 2207 | ||
2209 | // the request is for client window so we resize the frame to it first | 2208 | // the request is for client window so we resize the frame to it first |
2210 | if (frame().width() != cw || frame().height() != ch) { | 2209 | if (frame().width() != cw || frame().height() != ch) { |
2211 | frame().resizeForClient(cw, ch); | 2210 | if (frame().x() != cx || frame().y() != cy) |
2211 | frame().moveResizeForClient(cx, cy, cw, ch); | ||
2212 | else | ||
2213 | frame().resizeForClient(cw, ch); | ||
2212 | send_notify = true; | 2214 | send_notify = true; |
2213 | } | 2215 | } else if (frame().x() != cx || frame().y() != cy) { |
2214 | |||
2215 | if (frame().x() != cx || frame().y() != cy) { | ||
2216 | move(cx, cy); | 2216 | move(cx, cy); |
2217 | // since we already send a notify in move we don't need to do that again | 2217 | // since we already send a notify in move we don't need to do that again |
2218 | send_notify = false; | 2218 | send_notify = false; |
@@ -2627,7 +2627,7 @@ void FluxboxWindow::applyDecorations(bool initial) { | |||
2627 | 2627 | ||
2628 | // if the location changes, shift it | 2628 | // if the location changes, shift it |
2629 | if (grav_x != 0 || grav_y != 0) | 2629 | if (grav_x != 0 || grav_y != 0) |
2630 | frame().move(grav_x + frame().x(), grav_y + frame().y()); | 2630 | move(grav_x + frame().x(), grav_y + frame().y()); |
2631 | 2631 | ||
2632 | frame().reconfigure(); | 2632 | frame().reconfigure(); |
2633 | } | 2633 | } |
diff --git a/src/Window.hh b/src/Window.hh index a07bf66..8c2fe46 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.94 2003/09/23 13:52:05 rathnor Exp $ | 25 | // $Id: Window.hh,v 1.95 2003/09/24 14:02:25 rathnor Exp $ |
26 | 26 | ||
27 | #ifndef WINDOW_HH | 27 | #ifndef WINDOW_HH |
28 | #define WINDOW_HH | 28 | #define WINDOW_HH |
@@ -236,7 +236,7 @@ public: | |||
236 | void unmapNotifyEvent(XUnmapEvent &unmapev); | 236 | void unmapNotifyEvent(XUnmapEvent &unmapev); |
237 | void exposeEvent(XExposeEvent &ee); | 237 | void exposeEvent(XExposeEvent &ee); |
238 | void configureRequestEvent(XConfigureRequestEvent &ce); | 238 | void configureRequestEvent(XConfigureRequestEvent &ce); |
239 | void propertyNotifyEvent(Atom a); | 239 | void propertyNotifyEvent(WinClient &client, Atom a); |
240 | void enterNotifyEvent(XCrossingEvent &ev); | 240 | void enterNotifyEvent(XCrossingEvent &ev); |
241 | void leaveNotifyEvent(XCrossingEvent &ev); | 241 | void leaveNotifyEvent(XCrossingEvent &ev); |
242 | //@} | 242 | //@} |
@@ -374,11 +374,11 @@ private: | |||
374 | 374 | ||
375 | bool getState(); | 375 | bool getState(); |
376 | /// gets title string from client window and updates frame's title | 376 | /// gets title string from client window and updates frame's title |
377 | void updateTitleFromClient(); | 377 | void updateTitleFromClient(WinClient &client); |
378 | /// gets icon name from client window | 378 | /// gets icon name from client window |
379 | void updateIconNameFromClient(); | 379 | void updateIconNameFromClient(WinClient &client); |
380 | void getMWMHints(); | 380 | void updateMWMHintsFromClient(WinClient &client); |
381 | void getBlackboxHints(); | 381 | void updateBlackboxHintsFromClient(WinClient &client); |
382 | void saveBlackboxAttribs(); | 382 | void saveBlackboxAttribs(); |
383 | void setNetWMAttributes(); | 383 | void setNetWMAttributes(); |
384 | void associateClientWindow(); | 384 | void associateClientWindow(); |