[Top][All Lists]

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

[Qemu-devel] Re: gtk2 driver

From: Jim C. Brown
Subject: [Qemu-devel] Re: gtk2 driver
Date: Fri, 27 May 2005 11:28:33 -0400
User-agent: Mutt/1.4i

On Fri, May 27, 2005 at 12:59:32PM +0200, Sebastien Bechet wrote:
> Hello Jim,
> As fabrice know, i have done some work about it, but no time to debug.
> Nevertheless, I think the code is near to work.
> Maybe it can help you or someone to finish gtk2 driver...
> (you can apply it directly on CVS, see TODO on gtk.c top for bugs)
> Bye.
> -- 
> Sebastien Bechet <address@hidden>
> av7.net

Wow...your code looks almost identical to mine. I suppose that shouldnt be
surprising, considering that they are both based off of sdl.c ... still I wish
I had known about this before I spent 10 hours writing a gtk2.c from scratch.

I fixed the segfault, so ... the code is ready for release. Apply Makefile.diff
to the Makefile in i386-softmmu - you may need to change the include dirs or
library flags. Check 'gtk-config --cflags' and 'gtk-config --libs' to be sure.
Note that the patched Makefile compiles gtk2.c into sdl.o, I plan on fixing
that very soon. Bugs:

- kludged Makefile - I do plan to merge in your configure and Makefile patches,
but this kludge allowed me to write/debug gtkqemu a lot faster
- modifier detection isnt working, so its difficult to get a grab and not
possible to ungrab - this is why the no-sdl-grab patch is included
- it is a bad idea to resize the window manually
- you cant close the GTK window normally - must use 'quit' in qemu monitor if
the OS doesnt close qemu thru APM
- GDK grab/ungrab code untested
- full screen mode untested
- need to use "-monitor stdio" because changing virtual consoles doesnt work
- probably a few more that I haven't noticed yet

However, it boots and runs fine with Minix, Windows 98, and KNOPPIX V3.7.

The major difference between your code and mine is that you use GdkPixbuf
while I paint a GdkImage directly on the window. I decided against GdkPixbuf
because it was too high level, and I wasn't sure how to convert the pixel
buffer into the format needed by vga.c

Personally, I think GTK is a bad way to go for something like this (SDL is a
better choice but ideally you'd want something like OpenGL). I only wrote this
because A) Fabrice continues to insist on GTK for linux but wont explain why
B) I wanted to see if it was possible and how it could be done and C) I had
a day off.

Attachment: gtk2.c
Description: Text document

Attachment: gdk_keysym.h
Description: Text document

Attachment: Makefile.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]