Re: [Patch] Re: [awesome bugs] #578 - spurious mouse_enter events when hovering

2009-08-15 Thread Julien Danjou
At 1250273039 time_t, Uli Schlachter wrote:
 diff --git a/wibox.c b/wibox.c
 index 7220f6e..6ef1715 100644
 --- a/wibox.c
 +++ b/wibox.c
 @@ -54,6 +54,9 @@ static void
  wibox_need_update(wibox_t *wibox)
  {
  wibox-need_update = true;
 +/* All out callers change the position of some widgets which means we 
 should
 + * generate a new mouse_enter event.
 + */

Yeah.

  wibox-mouse_over = NULL;
  }
  
 @@ -791,8 +794,10 @@ luaA_wibox_invalidate_byitem(lua_State *L, const void 
 *item)
  wibox_t *wibox = *w;
  if(luaA_wibox_hasitem(L, wibox, item))
  {
 -/* update wibox */
 -wibox_need_update(wibox);
 +/* update wibox. Don't use wibox_need_update() here because for 
 this
 + * specific case we don't want to touch wibox-mouse_over!
 + */
 +wibox-need_update = true;
  lua_pop(L, 1); /* remove widgets table */
  }

But AFAIU we want: the change of a widget in the table may say that we
are removing/adding a widget, so we need to redraw and that position may
change.

So I think your patch works in this specific case but has drawbacks in a
more general way. :)

-- 
Julien Danjou
// ᐰ jul...@danjou.info   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// I'm no superman.


signature.asc
Description: Digital signature


Re: [Patch] [awesome bugs] #578 - spurious mouse_enter events when hovering

2009-08-15 Thread Uli Schlachter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Julien Danjou wrote:
 At 1250273039 time_t, Uli Schlachter wrote:
 diff --git a/wibox.c b/wibox.c
 index 7220f6e..6ef1715 100644
 --- a/wibox.c
 +++ b/wibox.c
 @@ -54,6 +54,9 @@ static void
  wibox_need_update(wibox_t *wibox)
  {
  wibox-need_update = true;
 +/* All out callers change the position of some widgets which means we 
 should
 + * generate a new mouse_enter event.
 + */
 
 Yeah.

Whoops, s/out/our.

  wibox-mouse_over = NULL;
  }
  
 @@ -791,8 +794,10 @@ luaA_wibox_invalidate_byitem(lua_State *L, const void 
 *item)
  wibox_t *wibox = *w;
  if(luaA_wibox_hasitem(L, wibox, item))
  {
 -/* update wibox */
 -wibox_need_update(wibox);
 +/* update wibox. Don't use wibox_need_update() here because for 
 this
 + * specific case we don't want to touch wibox-mouse_over!
 + */
 +wibox-need_update = true;
  lua_pop(L, 1); /* remove widgets table */
  }
 
 But AFAIU we want: the change of a widget in the table may say that we
 are removing/adding a widget, so we need to redraw and that position may
 change.

If we remove/add a widget we are not in this code at all. Instead we would be in
luaA_wibox_newindex()' A_TK_WIDGETS case.
But yeah, stuff like 'mytextbox.text = new text' goes through this code and
could change the widget's size (or even some other widget's size which makes all
other widgets move around alittle). Damn. :(

 So I think your patch works in this specific case but has drawbacks in a
 more general way. :)

Ideas how to fix this? We could check in wibox_draw() if the widget under the
mouse changed. Would this help and fix this? Want me to write and submit this?
Anything I missed where this would still break? Should I ask more questions?
Actually I like that idea...

I'm talking about sth like this:

static void wibox_draw(wibox_t *wibox)
{
  [other stuff]
  widget_render(wibox);
  widget_t *tmp = widget_getbycoords(...);
  if (tmp != wibox-mouse_over)
  {
mouse_leave the old one, mouse_enter the new one.
  }
  [other stuff]
}

Uli
- --
Do you know that books smell like nutmeg or some spice from a foreign land?
  -- Faber in Fahrenheit 451
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iQEcBAEBCAAGBQJKhpoyAAoJECLkKOvLj8sGrKkH/3Xy7kQPd4XrYxGVOF64KF8p
a8gsBlkm/PmiPci2n4LAz3mq9vlobWukph0z/v+Iel5VaYsCl1PzERMIHvb4iWQn
wmSwwYsnhdiIGIozwnrEK8upDLWCDFN9UgsL1ZEsOI14d070jpuPqQNA+gzZuR++
9KP0f/f+e3bnju7/KnR7bOwy4wsoVNT+SgGoOf0zfcBDi5mEUnwmcAbdYov911qq
4IV/SicfmCwNQhA7B02nVFLpTrlBj0ycqEXYwFKWPcDh+Aw3UbrwKPVHeD51QaJg
plvEnfP4tH01sj+STkmOeqoo7jFmHmymW7fWa32TZSM1tpyKgfFos7l8K5iZ/40=
=7/qq
-END PGP SIGNATURE-

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.