diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2009-12-18 07:05:07 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2009-12-18 07:05:07 (GMT) |
commit | 46261a8284730a16d664fa89423fc5728ed284b4 (patch) | |
tree | c81d7962fe924f5bfca44dc0254304cb537544b9 /src/CurrentWindowCmd.cc | |
parent | 79859c94482e4602eb22c35b988027ab199734a6 (diff) | |
download | fluxbox-46261a8284730a16d664fa89423fc5728ed284b4.zip fluxbox-46261a8284730a16d664fa89423fc5728ed284b4.tar.bz2 |
implemented 'MoveN' and 'ClickN' support in keys file.
the hardcoded 'OnTitlebar Mouse1 :Raise' (see Window.cc, FluxboxWindow::buttonPressEvent())
is disabled for now, should be added to fluxbox-update_configs
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r-- | src/CurrentWindowCmd.cc | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index b73de01..f896009 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -262,11 +262,26 @@ void GoToTabCmd::real_execute() { | |||
262 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); | 262 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); |
263 | 263 | ||
264 | void StartMovingCmd::real_execute() { | 264 | void StartMovingCmd::real_execute() { |
265 | |||
266 | int x; | ||
267 | int y; | ||
265 | const XEvent &last = Fluxbox::instance()->lastEvent(); | 268 | const XEvent &last = Fluxbox::instance()->lastEvent(); |
266 | if (last.type == ButtonPress) { | 269 | switch (last.type) { |
267 | const XButtonEvent &be = last.xbutton; | 270 | case ButtonPress: |
268 | fbwindow().startMoving(be.x_root, be.y_root); | 271 | x = last.xbutton.x_root; |
272 | y = last.xbutton.y_root; | ||
273 | break; | ||
274 | |||
275 | case MotionNotify: | ||
276 | x = last.xmotion.x_root; | ||
277 | y = last.xmotion.y_root; | ||
278 | break; | ||
279 | |||
280 | default: | ||
281 | return; | ||
269 | } | 282 | } |
283 | |||
284 | fbwindow().startMoving(x, y); | ||
270 | } | 285 | } |
271 | 286 | ||
272 | FbTk::Command<void> *StartResizingCmd::parse(const string &cmd, const string &args, | 287 | FbTk::Command<void> *StartResizingCmd::parse(const string &cmd, const string &args, |
@@ -305,15 +320,27 @@ FbTk::Command<void> *StartResizingCmd::parse(const string &cmd, const string &ar | |||
305 | REGISTER_COMMAND_PARSER(startresizing, StartResizingCmd::parse, void); | 320 | REGISTER_COMMAND_PARSER(startresizing, StartResizingCmd::parse, void); |
306 | 321 | ||
307 | void StartResizingCmd::real_execute() { | 322 | void StartResizingCmd::real_execute() { |
323 | |||
324 | int x; | ||
325 | int y; | ||
308 | const XEvent &last = Fluxbox::instance()->lastEvent(); | 326 | const XEvent &last = Fluxbox::instance()->lastEvent(); |
309 | if (last.type == ButtonPress) { | 327 | switch (last.type) { |
310 | const XButtonEvent &be = last.xbutton; | 328 | case ButtonPress: |
311 | int x = be.x_root - fbwindow().x() | 329 | x = last.xbutton.x_root; |
312 | - fbwindow().frame().window().borderWidth(); | 330 | y = last.xbutton.y_root; |
313 | int y = be.y_root - fbwindow().y() | 331 | break; |
314 | - fbwindow().frame().window().borderWidth(); | 332 | case MotionNotify: |
315 | fbwindow().startResizing(x, y, fbwindow().getResizeDirection(x, y, m_mode)); | 333 | x = last.xmotion.x_root; |
334 | y = last.xmotion.y_root; | ||
335 | break; | ||
336 | default: | ||
337 | return; | ||
316 | } | 338 | } |
339 | |||
340 | x -= fbwindow().x() - fbwindow().frame().window().borderWidth(); | ||
341 | y -= fbwindow().y() - fbwindow().frame().window().borderWidth(); | ||
342 | |||
343 | fbwindow().startResizing(x, y, fbwindow().getResizeDirection(x, y, m_mode)); | ||
317 | } | 344 | } |
318 | 345 | ||
319 | REGISTER_COMMAND(starttabbing, StartTabbingCmd, void); | 346 | REGISTER_COMMAND(starttabbing, StartTabbingCmd, void); |