summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Window.cc100
1 files changed, 40 insertions, 60 deletions
diff --git a/src/Window.cc b/src/Window.cc
index e4c00fe..fab5d53 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.118 2003/02/17 09:56:00 fluxgen Exp $ 25// $Id: Window.cc,v 1.119 2003/02/17 22:42:52 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -117,8 +117,7 @@ FluxboxWindow::FluxboxWindow(Window w, BScreen *s, int screen_num,
117 tab(0), 117 tab(0),
118 m_frame(tm, imgctrl, screen_num, 0, 0, 100, 100), 118 m_frame(tm, imgctrl, screen_num, 0, 0, 100, 100),
119 m_layeritem(getFrameWindow(), layer), 119 m_layeritem(getFrameWindow(), layer),
120 m_layernum(layer.getLayerNum()) 120 m_layernum(layer.getLayerNum()) {
121 {
122 121
123 122
124 123
@@ -1980,21 +1979,15 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
1980 } 1979 }
1981 1980
1982 if (m_frame.clientArea() == be.window) { 1981 if (m_frame.clientArea() == be.window) {
1983
1984 if (m_windowmenu.isVisible()) //hide menu if its visible
1985 m_windowmenu.hide();
1986
1987 raise(); 1982 raise();
1988 1983 XAllowEvents(display, ReplayPointer, be.time);
1989 XAllowEvents(display, ReplayPointer, be.time); 1984 } else {
1990
1991 } else {
1992
1993 button_grab_x = be.x_root - m_frame.x() - screen->getBorderWidth(); 1985 button_grab_x = be.x_root - m_frame.x() - screen->getBorderWidth();
1994 button_grab_y = be.y_root - m_frame.y() - screen->getBorderWidth(); 1986 button_grab_y = be.y_root - m_frame.y() - screen->getBorderWidth();
1995 if (m_windowmenu.isVisible())
1996 m_windowmenu.hide();
1997 } 1987 }
1988
1989 if (m_windowmenu.isVisible())
1990 m_windowmenu.hide();
1998 } 1991 }
1999 1992
2000} 1993}
@@ -2064,21 +2057,21 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2064 } 2057 }
2065 } 2058 }
2066 2059
2067 /* 2060
2068 if (! screen->doOpaqueMove()) { 2061 if (! screen->doOpaqueMove()) {
2069 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), 2062 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
2070 frame.move_x, frame.move_y, frame.resize_w, frame.resize_h); 2063 last_move_x, last_move_y,
2071 2064 m_frame.width(), m_frame.height());
2072 frame.move_x = dx; 2065
2073 frame.move_y = dy; 2066 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
2074 2067 dx, dy,
2075 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), 2068 m_frame.width(), m_frame.height());
2076 frame.move_x, frame.move_y, frame.resize_w, 2069 last_move_x = dx;
2077 frame.resize_h); 2070 last_move_y = dy;
2078 } else { 2071 } else {
2079 */ 2072
2080 moveResize(dx, dy, m_frame.width(), m_frame.height()); 2073 moveResize(dx, dy, m_frame.width(), m_frame.height());
2081 // } 2074 }
2082 2075
2083 if (screen->doShowWindowPos()) 2076 if (screen->doShowWindowPos())
2084 screen->showPosition(dx, dy); 2077 screen->showPosition(dx, dy);
@@ -2222,43 +2215,30 @@ void FluxboxWindow::startMoving(Window win) {
2222 m_windowmenu.hide(); 2215 m_windowmenu.hide();
2223 2216
2224 fluxbox->maskWindowEvents(client.window, this); 2217 fluxbox->maskWindowEvents(client.window, this);
2225 /* TODO: opaque moving 2218 last_move_x = frame().x();
2226 if (! screen->doOpaqueMove()) { 2219 last_move_y = frame().y();
2227 fluxbox->grab(); 2220 if (! screen->doOpaqueMove()) {
2228 2221 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
2229 frame.move_x = frame.x; 2222 frame().x(), frame().y(),
2230 frame.move_y = frame.y; 2223 frame().width(), frame().height());
2231 frame.move_ws = screen->getCurrentWorkspaceID(); 2224 screen->showPosition(frame().x(), frame().y());
2232 frame.resize_w = frame.width + screen->getBorderWidth2x(); 2225 }
2233 frame.resize_h = ((shaded) ? frame.title_h : frame.height) +
2234 screen->getBorderWidth2x();
2235
2236 if (screen->doShowWindowPos())
2237 screen->showPosition(frame.x, frame.y);
2238
2239 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
2240 frame.move_x, frame.move_y,
2241 frame.resize_w, frame.resize_h);
2242 }*/
2243} 2226}
2244 2227
2245void FluxboxWindow::stopMoving() { 2228void FluxboxWindow::stopMoving() {
2246 moving = false; 2229 moving = false;
2247 Fluxbox *fluxbox = Fluxbox::instance(); 2230 Fluxbox *fluxbox = Fluxbox::instance();
2248 2231
2249 fluxbox->maskWindowEvents(0, (FluxboxWindow *) 0); 2232 fluxbox->maskWindowEvents(0, 0);
2250
2251 /* TODO: non opaque moving
2252 if (! screen->doOpaqueMove()) {
2253 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
2254 frame.move_x, frame.move_y, frame.resize_w,
2255 frame.resize_h);
2256 2233
2257 configure(frame.move_x, frame.move_y, frame.width, frame.height); 2234
2258 fluxbox->ungrab(); 2235 if (! screen->doOpaqueMove()) {
2259 } else 2236 XDrawRectangle(FbTk::App::instance()->display(), screen->getRootWindow(), screen->getOpGC(),
2260 */ 2237 last_move_x, last_move_y,
2261 moveResize(m_frame.x(), m_frame.y(), m_frame.width(), m_frame.height()); 2238 frame().width(), frame().height());
2239 moveResize(last_move_x, last_move_y, m_frame.width(), m_frame.height());
2240 } else
2241 moveResize(m_frame.x(), m_frame.y(), m_frame.width(), m_frame.height());
2262 2242
2263 screen->hideGeometry(); 2243 screen->hideGeometry();
2264 XUngrabPointer(display, CurrentTime); 2244 XUngrabPointer(display, CurrentTime);