Re: unable to maximize gtk window

2013-09-22 Thread Simon

On 17/09/2013 1:19 AM, Jon TURNEY wrote:

On 11/09/2013 19:05, Simon wrote:

On 12/09/2013 2:53 AM, Jon TURNEY wrote:

On 09/09/2013 15:43, Simon wrote:

Thanks for reporting this problem and the testcase.

I've added a patch improves the window hint conversion in multiwindow mode so
that the hint which gtk_window_maximize() sets is now recognized as
maximizing
the window.

I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
improves things for you?

(This is a x86 binary. if you need an x64 binary, please let me know and I'll
generate one)

Thanks, that appears to fix the testcase, but terminator still has the same
problems, I'll try to find out what is happening there.

'terminator -m' works correctly for me with that snapshot.


It does for me too, but if I start terminator with no command line arguments
(directly after I start x server), then maximize the window using the windows
button, or by double clicking the title bar, I get a window that's not fully
maximized.

This works for me, but this sounds like a different problem to the one you
first reported.

There is a difference between a window asking to maximize itself (via the
appearance hint that gtk_window_maximize() sets), and using the window manager
to maximize using the frame controls (title bar double click or maximize button)

I'm not sure what you mean by 'not fully maximized', this seems different to
'not maximized'

Perhaps the window may not get fully maximized as it's frame dimensions are
(should be?) constrained to ensure that they are an integer multiple of the
character cell size?

Yes indeed it is a different problem, I've dug deeper and found the 
cause, I've attached a test-case.
The problem is that gtk's window-state-event signals aren't being fired 
when a window maximizes or minimizes.
The correct behavior in the test-case, is that 'test' will be printed 
twice, once on startup, once when the user maximizes the window, and 
once when the user minimizes the window.


Simon


#include gtk/gtk.h

gboolean on_window_state_event(GtkWidget *widget, GdkEventWindowState *event, 
gpointer user_data){
puts(test);
return TRUE;
}

int main( int argc, char *argv[]){
GtkWidget *window;

gtk_init(argc, argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), GtkButton);
gtk_window_set_default_size(GTK_WINDOW(window), 230, 150);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);

g_signal_connect(G_OBJECT(window), destroy, 
G_CALLBACK(gtk_main_quit), NULL);

g_signal_connect(
G_OBJECT(window), 
window-state-event, 
G_CALLBACK(on_window_state_event), 
(gpointer)NULL
);

gtk_widget_show_all(window);

gtk_main();

return 0;
}

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/

Re: unable to maximize gtk window

2013-09-16 Thread Jon TURNEY
On 11/09/2013 19:05, Simon wrote:
 On 12/09/2013 2:53 AM, Jon TURNEY wrote:
 On 09/09/2013 15:43, Simon wrote:
 Thanks for reporting this problem and the testcase.

 I've added a patch improves the window hint conversion in multiwindow mode 
 so
 that the hint which gtk_window_maximize() sets is now recognized as
 maximizing
 the window.

 I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
 improves things for you?

 (This is a x86 binary. if you need an x64 binary, please let me know and 
 I'll
 generate one)
 Thanks, that appears to fix the testcase, but terminator still has the same
 problems, I'll try to find out what is happening there.
 'terminator -m' works correctly for me with that snapshot.

 It does for me too, but if I start terminator with no command line arguments
 (directly after I start x server), then maximize the window using the windows
 button, or by double clicking the title bar, I get a window that's not fully
 maximized.

This works for me, but this sounds like a different problem to the one you
first reported.

There is a difference between a window asking to maximize itself (via the
appearance hint that gtk_window_maximize() sets), and using the window manager
to maximize using the frame controls (title bar double click or maximize button)

I'm not sure what you mean by 'not fully maximized', this seems different to
'not maximized'

Perhaps the window may not get fully maximized as it's frame dimensions are
(should be?) constrained to ensure that they are an integer multiple of the
character cell size?

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: unable to maximize gtk window

2013-09-11 Thread Simon

On 12/09/2013 2:53 AM, Jon TURNEY wrote:

On 09/09/2013 15:43, Simon wrote:

Thanks for reporting this problem and the testcase.

I've added a patch improves the window hint conversion in multiwindow mode so
that the hint which gtk_window_maximize() sets is now recognized as maximizing
the window.

I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
improves things for you?

(This is a x86 binary. if you need an x64 binary, please let me know and I'll
generate one)

Thanks, that appears to fix the testcase, but terminator still has the same
problems, I'll try to find out what is happening there.

'terminator -m' works correctly for me with that snapshot.

It does for me too, but if I start terminator with no command line 
arguments (directly after I start x server), then maximize the window 
using the windows button, or by double clicking the title bar, I get a 
window that's not fully maximized.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: unable to maximize gtk window

2013-09-11 Thread Jon TURNEY
On 09/09/2013 15:43, Simon wrote:
 Thanks for reporting this problem and the testcase.

 I've added a patch improves the window hint conversion in multiwindow mode so
 that the hint which gtk_window_maximize() sets is now recognized as 
 maximizing
 the window.

 I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
 improves things for you?

 (This is a x86 binary. if you need an x64 binary, please let me know and I'll
 generate one)
 Thanks, that appears to fix the testcase, but terminator still has the same
 problems, I'll try to find out what is happening there.

'terminator -m' works correctly for me with that snapshot.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: unable to maximize gtk window

2013-09-09 Thread Jon TURNEY
On 01/09/2013 16:13, Simon wrote:
 $ gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0`
 $ ./simple.exe
 
 The window fails to maximize on startup
 I've found this out when using gnome terminator on cygwin, which fails to
 maximize on startup, and strangely is only able to maximize when opening up a
 new tab

Thanks for reporting this problem and the testcase.

I've added a patch improves the window hint conversion in multiwindow mode so
that the hint which gtk_window_maximize() sets is now recognized as maximizing
the window.

I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
improves things for you?

(This is a x86 binary. if you need an x64 binary, please let me know and I'll
generate one)

 On 01/09/2013 22:00, Angelo Graziosi wrote:
 Perhaps, there is a similar discussion for GTK builds of Emacs trunk on 
 Cygwin:
 
   http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-08/msg00953.html

This might be responsible for some of the problems listed there, but I think
there is still something not quite right about the way a maximized emacs
window is treated, so more work is needed.

[1] ftp://cygwin.com/pub/cygwinx/XWin.20130909-git-7cebbec4b67fd4d8.exe.bz2

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: unable to maximize gtk window

2013-09-09 Thread Simon

Thanks for reporting this problem and the testcase.

I've added a patch improves the window hint conversion in multiwindow mode so
that the hint which gtk_window_maximize() sets is now recognized as maximizing
the window.

I've uploaded a snapshot at [1]. Perhaps you could try that and see if it
improves things for you?

(This is a x86 binary. if you need an x64 binary, please let me know and I'll
generate one)
Thanks, that appears to fix the testcase, but terminator still has the 
same problems, I'll try to find out what is happening there.


Simon



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: unable to maximize gtk window

2013-09-01 Thread Angelo Graziosi

Simon wrote:

The window fails to maximize on startup


Perhaps, there is a similar discussion for GTK builds of Emacs trunk on 
Cygwin:


  http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-08/msg00953.html


Ciao,
 Angelo.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/