CENTER_ALWAYS behaviour



hi havoc,

you changed CENTER_ALWAYS behaviour in gtkwindow.c:

  /* Position Constraints
   * ====================
   *
   * POS_CENTER_ALWAYS is conceptually a constraint rather than
   * a default. The other POS_ values are used only when the
   * window is shown, not after that.
   *
   * However, we can't implement a position constraint as
   * "anytime the window size changes, center the window"
   * because this may well end up fighting the WM or user.  In
   * fact it gets in an infinite loop with at least one WM.
   *

as in 1.2, CENTER_ALWAYS is intended to re-center the window
if the size requisition changed e.g.:

screen0                                       screenWidth
|          +-----------------------+          |                       
|          |WindowWithLabelCentered|          |                       
|          +-----------------------+          |                       

change Label:
|        +---------------------------+      |                       
|        |WindowWithLongLabelCentered|      |                       
|        +---------------------------+      |                       

but we now have:
|          +---------------------------+    |                       
|          |WindowWithLongLabelCentered|    |                       
|          +---------------------------+    |                       

you're right in the above comment in that we couldn't recenter upon
every size change, e.g. if the window manager gave us a new size (i.e.
size changes from configure events), but size changes due to widget
tree layout changes need to still trigger the recentering code.

for a test case, try GLE's selector window, it now only shrinks/grows
to the right, instead of recentering.

---
ciaoTJ





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