I have an alternate proposal:

Since mouse.object_under_pointer() was the only function having problems with
widget_getbycoords(), adding two lines of code to make the cursor position in
object_under_pointer() relative to the wibox we are checking, solves the
problem without the neccessity to modify other, working functions. A patch
against current next is attached.

-- 
    Gregor Best
From ca5a738d67c2ae95e3d328fae59803c523c9c259 Mon Sep 17 00:00:00 2001
From: Gregor Best <[EMAIL PROTECTED]>
Date: Fri, 5 Dec 2008 16:37:38 +0100
Subject: [PATCH] mouse.c: fix object_under_pointer for screen != 1

Signed-off-by: Gregor Best <[EMAIL PROTECTED]>
---
 mouse.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mouse.c b/mouse.c
index dd15563..0140ea7 100644
--- a/mouse.c
+++ b/mouse.c
@@ -473,11 +473,14 @@ luaA_mouse_object_under_pointer(lua_State *L)
     if((wibox = wibox_getbywin(child)))
     {
         luaA_wibox_userdata_new(L, wibox);
+        
+        int16_t x = mouse_x - wibox->sw.geometry.x;
+        int16_t y = mouse_y - wibox->sw.geometry.y;
 
         widget_t *widget = widget_getbycoords(wibox->position, &wibox->widgets,
                                               wibox->sw.geometry.width,
                                               wibox->sw.geometry.height,
-                                              &mouse_x, &mouse_y);
+                                              &x, &y);
 
         if(widget)
         {
-- 
1.6.0.4

Attachment: signature.asc
Description: PGP signature

Reply via email to