From d6a32de0f85d80693461574a40b67ad1856bef7f Mon Sep 17 00:00:00 2001 From: akir Date: Fri, 3 Sep 2004 14:18:48 +0000 Subject: [PATCH] added -nearmouse to fbrun --- ChangeLog | 3 +++ util/fbrun/main.cc | 30 ++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc5470b8..ed92e75c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.11 +*04/09/03: + * Added -nearmouse to FbRun (Mathias) + main.cc *04/09/02: * Fix crash when in windowmenu->submenu and closing the app (Mathias) Remember.cc diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc index b68ea83d..68cf6f67 100644 --- a/util/fbrun/main.cc +++ b/util/fbrun/main.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: main.cc,v 1.11 2003/12/01 18:58:53 fluxgen Exp $ +// $Id: main.cc,v 1.12 2004/09/03 14:18:48 akir Exp $ #include "FbRun.hh" #include "App.hh" @@ -43,6 +43,7 @@ void showUsage(const char *progname) { " -h [height] Window height in pixels"<display(); + + if (XQueryPointer(dpy, DefaultRootWindow(dpy), + &ret_win, &child_win, + &x, &y, &wx, &wy, &mask)) { + + if ( x - (fbrun.width()/2) > 0 ) + x-= fbrun.width()/2; + if ( y - (fbrun.height()/2) > 0 ) + y-= fbrun.height()/2; + } + } + if (set_pos) fbrun.move(x, y);