Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-18 Thread Bram Moolenaar

Alexey Froloff wrote:

> gui_gtk.c:
> 
> 3131 if ((pos_x + c_size.width) > (wP + xP))
> 3132  pos_x = xP + wP - c_size.width - 2;
> 3133 /* Assume 'guiheadroom' indicates the title bar height... */
> 3134 if ((pos_y + c_size.height + p_ghr / 2) > (hP + yP))
> 3135 
> 3136 gtk_widget_set_uposition(child, pos_x, pos_y);
> 3137 }
> 
> gtk_widget_set_uposition() is called only if condition in line
> 3134 is true.

This does look strange.  I wonder who put it this way?
This is only for positioning dialogs, it's not related to your problem
of the Vim window having the wrong size.

> P.S.  Can anyone confirm, that running
> 
> gvim-gtk2 -u NONE -U NONE --cmd 'set lines=' --cmd 'set guifont=Bolkhov\ 
> VGA\ 10'   
> 
> _SOMETIMES_ does not resize gvim window?  I had to run this
> command ~40 times before I got that.  They say, it can be
> reproduced without setting 'guifont' (BTW, value doesn't matter),
> but I can't catch it.

There is some problem with event ordering in GTK related to resizing.
I'm not sure if there is someone who can fix this.

-- 
It is illegal for a driver to be blindfolded while operating a vehicle.
[real standing law in Alabama, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-17 Thread Alexey I. Froloff
* Alexey I. Froloff  [060917 16:45]:
> Running "for i in `seq 1 40`; do gvim-gtk2 -u NONE -U NONE --cmd
> 'set lines='; done" gives me one "unresized" gvim window.
With 'lines' set to 123!

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature


Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-17 Thread Alexey I. Froloff
* Yakov Lerner  [060917 14:05]:
> On both of my Linux computers, at home, and at work,
>   gvim --cmd 'set lines='
> *never* resizes the window.

> Does this count as "reproduction" :-) ?

Well, by "resize" I mean:

1. When gvim starts it draws it's window according to 'lines'
option - I can see it.
2. Some (very little) time after it resizes window according to
screen height and 'guiheadroom'.

Running "for i in `seq 1 40`; do gvim-gtk2 -u NONE -U NONE --cmd
'set lines='; done" gives me one "unresized" gvim window.
It's not 100% repeatable, it's just race somewhere in GTK2, and
only GTK2 code...

Instead of using --cmd you can use vimrc with one line "set
lines=".

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature


Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-17 Thread Yakov Lerner

On 9/16/06, Alexey I. Froloff <[EMAIL PROTECTED]> wrote:

gui_gtk.c:

3131 if ((pos_x + c_size.width) > (wP + xP))
3132pos_x = xP + wP - c_size.width - 2;
3133 /* Assume 'guiheadroom' indicates the title bar height... */
3134 if ((pos_y + c_size.height + p_ghr / 2) > (hP + yP))
3135
3136 gtk_widget_set_uposition(child, pos_x, pos_y);
3137 }

gtk_widget_set_uposition() is called only if condition in line
3134 is true.

P.S.  Can anyone confirm, that running

gvim-gtk2 -u NONE -U NONE --cmd 'set lines=' --cmd 'set guifont=Bolkhov\ 
VGA\ 10'

_SOMETIMES_ does not resize gvim window?


On both of my Linux computers, at home, and at work,
  gvim --cmd 'set lines='
*never* resizes the window.

Does this count as "reproduction" :-) ?

I think this is by design, as Tony explained.

On the other hand,
 gvim -u NONE -U NONE -c 'set lines='
always resizes. Note the difference: --cmd vs -c.
I think Tony is right, this is by design due to difference between
'--cmd' and '-c'.

Yakov


Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-17 Thread Alexey I. Froloff
* A.J.Mechelynck  [060916 18:21]:
[..skip..]
> Conclusion: Works for me.
It works _almost_ always.  This bug can be reproduced without
setting 'guifont', but it takes a bit more tries.  You can set
'lines' in gvimrc - I use --cmd for -U NONE.

I guess there's a race somewhere in GTK2 code...

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature


Re: GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-16 Thread A.J.Mechelynck

Alexey I. Froloff wrote:

gui_gtk.c:

3131 if ((pos_x + c_size.width) > (wP + xP))
3132pos_x = xP + wP - c_size.width - 2;
3133 /* Assume 'guiheadroom' indicates the title bar height... */
3134 if ((pos_y + c_size.height + p_ghr / 2) > (hP + yP))
3135 
3136 gtk_widget_set_uposition(child, pos_x, pos_y);

3137 }

gtk_widget_set_uposition() is called only if condition in line
3134 is true.

P.S.  Can anyone confirm, that running

gvim-gtk2 -u NONE -U NONE --cmd 'set lines=' --cmd 'set guifont=Bolkhov\ VGA\ 10'   


_SOMETIMES_ does not resize gvim window?  I had to run this
command ~40 times before I got that.  They say, it can be
reproduced without setting 'guifont' (BTW, value doesn't matter),
but I can't catch it.



- ":set" with several options acts from left to right; if there is an 
error, the rest isn't executed.
- ":set lines=9" set 'lines' to the maximum number of lines possible 
with the current 'guifont'. In this case, with the default font which 
was there before setting 'guifont' to "Bolkhov VGA 10". Therefore 
setting 'lines' and/or 'columns' should be done after setting 'guifont', 
not before. IIUC (but I may have misunderstood) setting these with --cmd 
(i.e., before processing the vimrc) doesn't change anything since (IIUC) 
when about to start the GUI, 'lines' 'columns' ":winpos" 'guifont' etc. 
are postponed until the GUI is started; I supposed they are still run in 
the order the commands were given.
- I can't test this exact way, as "Bolkhow VGA" is not available on this 
system. (I use "B&H LucidaTypewriter 10" for Latin and "FZFangSong 18" 
for CJK. I have "set lines=9 columns=9" in my vimrc (bracketed 
by 'if has("gui_running")' and after setting 'guifont') and my gvim 
(GTK2/Gnome Huge version) always starts maximized.


Conclusion: Works for me.


Best regards,
Tony.


GTK2 gui_gtk_position_in_parent() - bad indenting or missing operator?

2006-09-16 Thread Alexey I. Froloff
gui_gtk.c:

3131 if ((pos_x + c_size.width) > (wP + xP))
3132pos_x = xP + wP - c_size.width - 2;
3133 /* Assume 'guiheadroom' indicates the title bar height... */
3134 if ((pos_y + c_size.height + p_ghr / 2) > (hP + yP))
3135 
3136 gtk_widget_set_uposition(child, pos_x, pos_y);
3137 }

gtk_widget_set_uposition() is called only if condition in line
3134 is true.

P.S.  Can anyone confirm, that running

gvim-gtk2 -u NONE -U NONE --cmd 'set lines=' --cmd 'set guifont=Bolkhov\ 
VGA\ 10'   

_SOMETIMES_ does not resize gvim window?  I had to run this
command ~40 times before I got that.  They say, it can be
reproduced without setting 'guifont' (BTW, value doesn't matter),
but I can't catch it.

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature