After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 370099 - Make bacon-resize an object and multi-screen aware
Make bacon-resize an object and multi-screen aware
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-11-03 16:38 UTC by Bastien Nocera
Modified: 2008-01-12 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Encapsulate bacon-resize.[ch] in an object (8.61 KB, patch)
2007-05-06 00:17 UTC, Philip Withnall
none Details | Review
Make have-xvidmode a property (11.66 KB, patch)
2007-05-07 21:10 UTC, Philip Withnall
none Details | Review
Use the screen and display from the related video widget. (16.14 KB, patch)
2007-05-08 08:59 UTC, Jan Arne Petersen
needs-work Details | Review
GObjectify BaconResize (updated) (16.51 KB, patch)
2007-12-05 07:48 UTC, Philip Withnall
none Details | Review
GObjectify BaconResize (updated again) (17.04 KB, patch)
2008-01-08 19:17 UTC, Philip Withnall
none Details | Review
GObjectify BaconResize (updated again) (17.14 KB, patch)
2008-01-11 07:18 UTC, Philip Withnall
committed Details | Review

Description Bastien Nocera 2006-11-03 16:38:22 UTC
SSIA

We need to stop the calls to gdk_screen_width() and co., and remove the static objects.
Comment 1 Philip Withnall 2007-05-06 00:17:47 UTC
Created attachment 87637 [details] [review]
Encapsulate bacon-resize.[ch] in an object

This patch converts bacon-resize.[ch] to using an object, but doesn't attempt to remove any of the gdk_screen_width() (etc.) calls.

I'm also a bit iffy on the name of the "bacon_resize_resize" function, but it's what logically follows from the original "bacon_resize" function.
Comment 2 Philip Withnall 2007-05-06 20:21:32 UTC
On second thoughts, it might be better to have bacon_resize_new return the success boolean, and take a pointer for the new BaconResize as a parameter. I'll do this once I get some feedback on the issues above.
Comment 3 Jan Arne Petersen 2007-05-07 18:55:55 UTC
I would suggest to add have-xvidmode as a read-only property to the BaconResize object.
Comment 4 Philip Withnall 2007-05-07 21:10:51 UTC
Created attachment 87748 [details] [review]
Make have-xvidmode a property

As Jan suggested, I've moved have-xvidmode to a property of the BaconResize object.
Comment 5 Jan Arne Petersen 2007-05-08 08:59:48 UTC
Created attachment 87786 [details] [review]
Use the screen and display from the related video widget.

This is not really tested.
Comment 6 Philip Withnall 2007-05-08 16:00:01 UTC
Shouldn't bacon_set_video_widget actually be called bacon_resize_set_video_widget...or just set_video_widget, since it's private?

Wouldn't it also be a good idea to allow getting of the video-widget property, or am I just wanting this for completionness' sake? :-P
Comment 7 Jan Arne Petersen 2007-05-08 17:16:37 UTC
Hm, yes bacon_resize_set_video_widget would be better.

BaconResize is something like a private object of the video widget, so I don't see an use case for a readable property.
Comment 8 Bastien Nocera 2007-05-09 11:04:06 UTC
I don't think a readable property is needed, as the widget is only used to get a GdkDisplay and GdkScreen. But the code doesn't seem to take into account:
- screen changing after bacon_set_video_widget is called (ie. multi-head display, and the window being moved somewhere else)
- display changing

See bug 371544 and bug 369134
Comment 9 Philip Withnall 2007-05-09 17:45:47 UTC
I'm a bit out of my depth here (multihead makes my head spin), but would a solution be to connect to the video widget's "screen-changed" signal, and then update the fullscreen-ness on the new screen?
Comment 10 Bastien Nocera 2007-06-15 13:00:52 UTC
(In reply to comment #9)
> I'm a bit out of my depth here (multihead makes my head spin), but would a
> solution be to connect to the video widget's "screen-changed" signal, and then
> update the fullscreen-ness on the new screen?

Yeah, that would be enough.
Comment 11 Philip Withnall 2007-11-25 14:26:40 UTC
Updated patch status. Jan, if you don't have time to update your patch, I'll try and run with it sometime next week.
Comment 12 Jan Arne Petersen 2007-11-25 17:13:08 UTC
I don't have time to update.

There is a bug in the patch above. It should be
XF86VidModeGetModeLine (GDK_DISPLAY_XDISPLAY (display), GDK_SCREEN_XNUMBER (screen), &dotclock, &modeline)
instead of GDK_SCREEN_XSCREEN (screen).
Comment 13 Philip Withnall 2007-12-05 07:48:34 UTC
Created attachment 100228 [details] [review]
GObjectify BaconResize (updated)

This builds on Jan's patch, including his changes from comment #12, as well as now listening for screen changes as per comment #10.

Hopefully this is OK; it works fine on my single-screen setup, but I don't have a multi-head setup with which to test it.
Comment 14 Bastien Nocera 2008-01-08 14:10:32 UTC
I've done the multi-head support myself in trunk (to help with bug 472494). Could you please update your patch?
Comment 15 Philip Withnall 2008-01-08 19:17:45 UTC
Created attachment 102411 [details] [review]
GObjectify BaconResize (updated again)

Updated to merge your changes in with the changes from the last patch. I assume the listening to "screen-changed" is still required?
As usual, I haven't tested it on a multihead setup, as I don't have one. :-(
Comment 16 Bastien Nocera 2008-01-10 11:24:20 UTC
I broke it again... I'll test it and commit it when you've updated it again. Sorry about that.
Comment 17 Philip Withnall 2008-01-11 07:18:15 UTC
Created attachment 102575 [details] [review]
GObjectify BaconResize (updated again)

Here we go.
Comment 18 Bastien Nocera 2008-01-11 10:35:54 UTC
David, any chance you could test it works for you, in SVN?

2008-01-11  Bastien Nocera  <hadess@hadess.net>

        * src/backend/bacon-resize.c: 
        * src/backend/bacon-resize.h:
        Patch from Philip Withnall <pwithnall@svn.gnome.org> to turn
        the bacon-resize code into an object

        * src/backend/bacon-video-widget-gst-0.10.c:
        (bacon_video_widget_unrealize),
        (bacon_video_widget_set_fullscreen),
        (bacon_video_widget_new):
        * src/backend/bacon-video-widget-xine.c:
        (bacon_video_widget_realize),
        (bacon_video_widget_unrealize), 
        (bacon_video_widget_set_fullscreen):
        Port to the new API (Closes: #370099)
Comment 19 David Zeuthen (not reading bugmail) 2008-01-12 01:39:27 UTC
Yup, this also works nicely on my 2 x 1680x1050 dual monitor setup.
Comment 20 Bastien Nocera 2008-01-12 09:20:44 UTC
Great, closing. Thanks for the work Philip.