RE: gtk+-2.18, win32, and OpenGL

2010-02-15 Thread Shawn Bakhtiar



FYI ---

The same thing happens on the OS X version using the Native GTK (NON X 
Windows). No mater where the widget. It always takes up the entire windows, and 
does not respond to mouse input.

Could it be that the issue is not platform specific?





 EMAILING FOR THE GREATER GOOD
Join me

> Subject: Re: gtk+-2.18, win32, and OpenGL
> From: al...@redhat.com
> To: t.ev...@aranz.com
> Date: Mon, 15 Feb 2010 10:21:01 +0100
> CC: gtk-devel-l...@gnome.org
> 
> On Mon, 2010-02-15 at 12:07 +1300, Tim Evans wrote:
> > Previous with GTK+ 2.14 I had some custom code that would let me draw 
> > with OpenGL into a widget under win32.  After updating GTK+ 2.18 this 
> > code doesn't work properly any more, it turns the entire toplevel
> > window 
> > into an OpenGL area instead.
> > 
> > I've gotten part way to having it work by calling 
> > gdk_window_ensure_native() on the window behind my OpenGL area widget,
> > 
> > but some things are still broken:
> 
> Hmmm, ideally that should not be needed. Its not on the X11 version of
> client side windows. There the gdk_x11_drawable_get_xid() call will
> automatically create a native window if you call it on a client-side
> window. Win32 should do the same.
> 
> However, the win32 port of client side windows does not really seem
> fully done. Unfortunately I don't personally have time to work on it at
> the moment.
> 
> > 1. I've found I need to call SetWindowPos manually to resize the
> > native 
> > window when the widget is allocated.  Is this the expected behaviour?
> 
> No, this is likely another bug in win32 csw support.
> 
> > 2. Mouse events seem to be screwed up.  After clicking on my OpenGL
> > area 
> > widget, other widgets will not receive enter-notify-event until I
> > click 
> > again outside the widget, making buttons and other widgets not work. 
> > Is 
> > there a way to fix this?
> 
> same here.
> 
> 
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander LarssonRed Hat, Inc 
>al...@redhat.comalexander.lars...@gmail.com 
> He's a world-famous shark-wrestling househusband on his last day in the job. 
> She's a bloodthirsty punk bounty hunter from a different time and place. They 
> fight crime! 
> 
> ___
> gtk-devel-list mailing list
> gtk-devel-l...@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
  
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Drawing a GdkDrawable to a frame window from gdk_foreign_new ()

2010-02-15 Thread Sam Spilsbury
On Tue, Feb 16, 2010 at 10:15 AM, Sam Spilsbury  wrote:
> Hmm, my mail client must have cut this message into two mails (bizzare bug).
>
> In case it is actually the list doing this, here is the text of the
> mail in full: http://pastebin.ca/1797937
>
> Otherwise it is pasted below:
>
> Hey everyone,
>
> I'm helping to write a reparenting window manager and we are drawing
> some of our decorations using GDK.
>
> A X Window "frame" is provided to the application that draws the frame
> window and from this we create a GdkWindow * with
> gdk_window_foreign_new (). The colormap is set to the default colormap
> for the screen.
>
> The frame window provided to the application is the parent of a client
> window for our window manager and it's parent is a "wrapper" window
> between which the window manager handles. We draw directly into this
> "frame" window.
>
> From here, the decorations are drawn on to a GdkPixmap (made into a
> GdkDrawable) of the same depth as the frame window. Once that is done,
> that pixmap is copied on to the frame window using
> gdk_window_set_back_pixmap.
>
> Unfortunately, I must be missing something since it doesn't appear to
> render correctly. I dumped the pixmap and the corresponding frame
> window drawables using gdk_pixbuf_get_from_drawable and saving it
> using gdk_pixbuf_save. Linked at the bottom are corresponding images
> of the intended drawing on the frame window (the pixmap) and the
> drawable dump of the frame window. As you might see, the frame window
> is drawn in a corrupt fashion. I also tried calling gdk_window_clear
> () and dumping the drawable from that, but I get a similar result.
>
> I have also linked a pastebin to the code. Unfortunately, it's heavily
> linked to the development version of compiz, so you may need to
> compile that should you need to test it. The drawing happens in void
> draw_window_decoration (). The decoration size is calculated in
> calc_window_decoration_size (). We take the frame window and create a
> GdkWindow from it in add_frame_window ().

Ack, just realized I accidentally sent to gtk-devel and not
gtk-app-devel - apologies, I have cc'd the app-devel list

Sorry for bothering you!

Regards,

Sam

>
> Any pointers of what I might be doing wrong here would be great!
>
> Kind Regards,
>
> Sam
>
> [Intended window background] http://imgur.com/88W7x
> [Actual drawable dump of the window background] http://imgur.com/K44ed
> [Pastebin of the code, to where you should replace
> /gtk/window-decorator/gtk-window-decorator.c in the compiz/core
> section should you choose to test it] http://pastebin.ca/1797929
>
> On Tue, Feb 16, 2010 at 10:11 AM, Sam Spilsbury  wrote:
>> Hey everyone,
>>
>> I'm helping to write a reparenting window manager and we are drawing
>> some of our decorations using GDK.
>>
>> A X Window "frame" is provided to the application that draws the frame
>> window and from this we create a GdkWindow * with
>> gdk_window_foreign_new (). The colormap is set to the default colormap
>> for the screen.
>>
>> The frame window provided to the application is the parent of a client
>> window for our window manager and it's parent is a "wrapper" window
>> between which the window manager handles. We draw directly into this
>> "frame" window.
>>
>> From here, the decorations are drawn on to a GdkPixmap (made into a
>> GdkDrawable) of the same depth as the frame window. Once that is done,
>> that pixmap is copied on to the frame window using
>> gdk_window_set_back_pixmap.
>>
>> Unfortunately, I must be missing something since it doesn't appear to
>> render correctly. I dumped the pixmap and the corresponding frame
>> window drawables using gdk_pixbuf_get_from_drawable and saving it
>> using gdk_pixbuf_save. Linked at the bottom are corresponding images
>> of the intended drawing on the frame window (the pixmap) and the
>> drawable dump of the frame window. As you might see, the frame window
>> is drawn in a corrupt fashion. I also tried calling gdk_window_clear
>> () and dumping the drawable from that, but I get a similar result.
>>
>> I have also linked a pastebin to the code. Unfortunately, it's heavily
>> linked to the development version of compiz, so you may need to
>> compile that should you need to test it. The drawing happens in void
>> draw_window_decoration (). The decoration size is calculated in
>> calc_window_decoration_size (). We take the frame window and create a
>> GdkWindow from it in add_frame_window ().
>>
>> Any pointers of what I might be doing wrong here would be great!
>>
>> Kind Regards,
>>
>> Sam
>>
>> [Intended window background] http://imgur.com/88W7x
>> [Actual drawable dump of the window background] http://imgur.com/K44ed
>> [Pastebin of the code, to where you should replace
>> /gtk/window-decorator/gtk-window-decorator.c in the compiz/core
>> section should you choose to test it] http://pastebin.ca/1797929
>>
>> --
>> Sam Spilsbury
>>
>
>
>
> --
> Sam Spilsbury
>



-- 
Sam Spilsbury
__