Notifications
Clear all

[Closed] cui.unregisterDialogBar moves window

I’ve been looking into what seems to be a bug in the cui.unregisterDialogBar function. It moves the window a few pixels. In windows xp it’s 2 pixels down, in windows 7 it’s even 6 pixels down, and 4pixels to the right.

Here’s the code I used to test this:

rollout r "rollout" (
  	button btn "btn";
  )
  
  createDialog r style:#(#style_toolwindow, #style_sysmenu, #style_resizing);
  cui.registerDialogBar r style:#(cui_floatable, cui_handles);

Run this once without closing the dialog, then add:

cui.unregisterDialogBar r

run the code again and notice that the window is in a different position!

A ‘solution’ to overcome this would be to use setDialogPos after unregistering to correct the movement, but since the amount to be corrected seems to depend on operating system (perhaps even on theme?) it does get a bit annoying.

Any ideas on this issue?