gtk2 driver

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gtk2 driver

Jim C. Brown
Mouse grabbing works now (cursor will go invisible and strange "bumping"
problems). Also you can grab the mouse just by clicking the left mouse
button again.

The user can no longer manually resize the qemu gtk window.

Now when you close the GTK window, it signals qemu to shutdown (as if you had
typed "quit" from the monitor).

Fullscreen mode is still broken (the window will resize, but the image on the
window will not). This will be tricky to fix as software scaling will be
necessary to get the image to be the right size/shape. Unlike SDL or OpenGL,
which could alter the video resolution of the X server. Perhaps the best
solution is to use an embedded GTK GLX widget to render the image. What do
you think Fabrice?

New gtk2.c attached.

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

gtk2.c (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Lionel Ulmer
On Mon, May 30, 2005 at 01:11:09PM -0400, Jim C. Brown wrote:
> Fullscreen mode is still broken (the window will resize, but the image on the
> window will not). This will be tricky to fix as software scaling will be
> necessary to get the image to be the right size/shape. Unlike SDL or OpenGL,
> which could alter the video resolution of the X server. Perhaps the best
> solution is to use an embedded GTK GLX widget to render the image. What do
> you think Fabrice?

Why not switch to SDL output when the user requests going 'full-screen' ? It
would be a bit of a hack, but well, it could work :-)

Otherwise, just use plain X11 calls to change resolution (via XRandr or via
Xvidmode). The problem being always to properly 'align' this window to be
the only one on screen.

       Lionel

--
                 Lionel Ulmer - http://www.bbrox.org/


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
On Mon, May 30, 2005 at 09:10:43PM +0200, Lionel Ulmer wrote:

> On Mon, May 30, 2005 at 01:11:09PM -0400, Jim C. Brown wrote:
> > Fullscreen mode is still broken (the window will resize, but the image on the
> > window will not). This will be tricky to fix as software scaling will be
> > necessary to get the image to be the right size/shape. Unlike SDL or OpenGL,
> > which could alter the video resolution of the X server. Perhaps the best
> > solution is to use an embedded GTK GLX widget to render the image. What do
> > you think Fabrice?
>
> Why not switch to SDL output when the user requests going 'full-screen' ? It
> would be a bit of a hack, but well, it could work :-)
>

It's a very easy hack to write, and it wouldnt be very difficult to get to work.

There is a gtksdl widget for gtk2 that I could use just for this purpose -
that way you could still have say a drop down menubar to use (for the GUI).
Or the gtk code could simply call upon the SDL driver when it goes into
fullscreen mode.

> Otherwise, just use plain X11 calls to change resolution (via XRandr or via
> Xvidmode). The problem being always to properly 'align' this window to be
> the only one on screen.

This is also doable, but it is less portable (e.g. it wouldnt work on Windows).

Either of these approaches mean moving away from pure GTK/GDK. Fabrice hasn't
explained why, but he has made it clear that he wants the Linux to use GTK.
Also, I'd prefer not to use X11 in the gtk driver in the hopes of keeping it
Windows compatible.

>
>        Lionel
>
> --
> Lionel Ulmer - http://www.bbrox.org/
>
>
> _______________________________________________
> Qemu-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Fabrice Bellard
>>Otherwise, just use plain X11 calls to change resolution (via XRandr or via
>>Xvidmode). The problem being always to properly 'align' this window to be
>>the only one on screen.
>
>
> This is also doable, but it is less portable (e.g. it wouldnt work on Windows).
>
> Either of these approaches mean moving away from pure GTK/GDK. Fabrice hasn't
> explained why, but he has made it clear that he wants the Linux to use GTK.
> Also, I'd prefer not to use X11 in the gtk driver in the hopes of keeping it
> Windows compatible.

If GTK cannot support correct full screen output, then it is perfectly
acceptable to do direct X11 calls thru DGA/Xvidmode for example. Using
SDL for full screen is possible too, but I think it will be a source of
problems (see the keyboard bugs we have with SDL/Windows).

Fabrice.


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
On Mon, May 30, 2005 at 11:10:26PM +0200, Fabrice Bellard wrote:

> >>Otherwise, just use plain X11 calls to change resolution (via XRandr or
> >>via
> >>Xvidmode). The problem being always to properly 'align' this window to be
> >>the only one on screen.
> >
> >
>
> If GTK cannot support correct full screen output, then it is perfectly
> acceptable to do direct X11 calls thru DGA/Xvidmode for example.
>
> Fabrice.
>
> >This is also doable, but it is less portable (e.g. it wouldnt work on
> >Windows).
> >

Ok this is what I've decided to do. In order to ensure that gtk2.c will work on
windows, I have decided to keep the fullscreen code separate.

There will be a fullscreen.h that defines the 4 functions that gtk2.c depends
on, and there will be a fullscreen "driver" of the name <library>_fs.c that
implements these functions.

I've written an xvid_fs.c which implements fullscreen mode via the Xvidmode
extension as well as a null_fs.c which doesn't do anything.

This way, Linux/FreeBSD/etc users can use the xvid_fs driver to get fullscreen
mode with gtk and Windows users can use the null_fs driver to use gtk mode.

The idea is that someone could implement a win32_fs driver that would enable
fullscreen mode in Windows. I do not know enough about win32api programming to
write this myself.

If gtk mode is enabled, the configure script will select the correct driver
by default (xvid_fs on unix, null_fs for everyone else) but there will be an
option to override this.

I have a few kinks to work out (plus some configure/Makefile diffs to write)
but expect a patch and the new files in a few hours.

On a side note, has anyone tried to use the gtk2 driver on windows? If so, can
you tell me what happened?

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
Here is the new driver. Patch is against a clean qemu directory. Once you
apply the patch, dump the attached files into the qemu root directory and
run configure with '--enable-gtk' option. The '--set-fs-driver=' option
exists but there should be no need to use it.

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

gtk2.c (21K) Download Attachment
gdk_keysym.h (8K) Download Attachment
fullscreen.h (169 bytes) Download Attachment
null_fs.c (347 bytes) Download Attachment
xvid_fs.c (2K) Download Attachment
qemu-gtk-patch.diff (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Sylvain Petreolle
--- "Jim C. Brown" <[hidden email]> a ?crit :

> Here is the new driver. Patch is against a clean qemu directory. Once you
> apply the patch, dump the attached files into the qemu root directory and
> run configure with '--enable-gtk' option. The '--set-fs-driver=' option
> exists but there should be no need to use it.
>
Hunks #2 and #3 of vl.c fail to apply to a new tree checked today,
could you post an updated patch ?

Kind regards,

Usurp (aka Sylvain Petreolle)

humans are like computers,
yesterday the BIOS was all
- today its just a word


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
On Tue, May 31, 2005 at 04:15:34PM +0200, Sylvain Petreolle wrote:
> --- "Jim C. Brown" <[hidden email]> a ?crit :
>
> > Here is the new driver. Patch is against a clean qemu directory. Once you
> > apply the patch, dump the attached files into the qemu root directory and
> > run configure with '--enable-gtk' option. The '--set-fs-driver=' option
> > exists but there should be no need to use it.
> >
> Hunks #2 and #3 of vl.c fail to apply to a new tree checked today,
> could you post an updated patch ?

Attached is a patch that omits the vl.c hunks and a vl.c.diff patch that
should work.

The problem was that I have the no-sdl-grab patch applied to my vl.c while
a clean tree doesn't.

>
> Kind regards,
>
> Usurp (aka Sylvain Petreolle)
>
> humans are like computers,
> yesterday the BIOS was all
> - today its just a word
>
>
> _______________________________________________
> Qemu-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

qemu-gtk-patch.diff (4K) Download Attachment
vl.c.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
In reply to this post by Jim C. Brown
On Mon, May 30, 2005 at 08:24:09PM -0400, Jim C. Brown wrote:
> Here is the new driver. Patch is against a clean qemu directory. Once you
> apply the patch, dump the attached files into the qemu root directory and
> run configure with '--enable-gtk' option. The '--set-fs-driver=' option
> exists but there should be no need to use it.
>
> --
> Infinite complexity begets infinite beauty.
> Infinite precision begets infinite perfection.

Here is an updated version that partically fixes problems with moving the mouse
when in fullscreen mode (sometimes you can move the mouse anyways and screw up
alignment in spite of this).

New gtk2.c attached. Also gdk_window_set_pointer.c attached. This works for
Linux/X11, Windows code should be ok but it is untested. (This is to overcome
a deliberate oversight in the GDK library, which does not provide a way to
set the location of the mouse pointer. GTK-fb will require an even uglier
hack.)


_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

gtk2.c (21K) Download Attachment
gdk_set_window_pointer.c (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
On Tue, May 31, 2005 at 03:45:03PM -0400, Jim C. Brown wrote:

> On Mon, May 30, 2005 at 08:24:09PM -0400, Jim C. Brown wrote:
> > Here is the new driver. Patch is against a clean qemu directory. Once you
> > apply the patch, dump the attached files into the qemu root directory and
> > run configure with '--enable-gtk' option. The '--set-fs-driver=' option
> > exists but there should be no need to use it.
> >
> > --
> > Infinite complexity begets infinite beauty.
> > Infinite precision begets infinite perfection.
>
> Here is an updated version that partically fixes problems with moving the mouse
> when in fullscreen mode (sometimes you can move the mouse anyways and screw up
> alignment in spite of this).
>
> New gtk2.c attached. Also gdk_window_set_pointer.c attached. This works for
> Linux/X11, Windows code should be ok but it is untested. (This is to overcome
> a deliberate oversight in the GDK library, which does not provide a way to
> set the location of the mouse pointer. GTK-fb will require an even uglier
> hack.)
>
> _______________________________________________
> Qemu-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
This gtk2.c does a better job of fixing the bug. Mouse shouldnt be able to
affect alignment anymore. Seems to make the mouse cursor move slower, not sure
why, otherwise it has no known bugs. Requires the gdk_set_window_pointer.c that
I posted previously.

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

gtk2.c (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk2 driver

Jim C. Brown
Updated gtk2.c and xvid_fs.c; Fullscreen mode now works perfectly, there is no
more title bar above qemu window. "Your illusion is now complete." I may or
may not hack gdk_set_window_pointer.c to support linux framebuffer, if I do
I'll probably add a fb_fs.c to support fullscreen mode in the framebuffer as
well. Otherwise I do not plan on adding more to this - for X11 it already
fully supports everything that the SDL version did.

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

_______________________________________________
Qemu-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

gtk2.c (21K) Download Attachment
xvid_fs.c (2K) Download Attachment
Loading...