Race condition with 'window-added' event and get_monitor()?



Hello all,

  I think I've encountered a race condition with the get_monitor()
  method of meta window.  For context, I'm working on an extension
  called 'shellshape' and am running gnome 3.4.0.  This specific issue
  is brought up here https://github.com/gfxmonk/shellshape/issues/21

  It appears that in callbacks that fire off of the 'window-added'
  event of a workspace, the value returned by get_monitor is
  unreliable.  I inconsistently get the wrong value back.  The value
  is within the possible range of values (0, or 1 if I have two
  monitors registered) but the value returned doesn't always reflect
  which monitor the new window is actually on.

  If I delay the execution of the get_monitor method (with, say,
  Mainloop.timeout_add_seconds) then I always get the right answer
  back from get_monitor.

  At what point in the window's creation can we be assured that it is
  fully set up, or really, at what point can we be assured that the
  value returned by get_monitor is correct?

  Is this a bug?  Or is it expected behavior and we're just using the
  wrong events?

Cheers-
  -Ralph


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]