Bug#329057: [Patch] Re: Bug#329057: gnome-randr-applet: "Inverted" rotation selected automatically (and wrongfully)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug#329057: [Patch] Re: Bug#329057: gnome-randr-applet: "Inverted" rotation selected automatically (and wrongfully)

Mikael Nilsson
Well, I was bored and this has bugged me a few times, so here's the fix:

--- src/grandr.c.orig   2006-04-13 01:39:52.000000000 +0200
+++ src/grandr.c        2006-04-13 01:46:19.000000000 +0200
@@ -253,7 +253,7 @@

       while (cur != NULL)
        {
-         if ((1 << grandr->xr_current_rotation) == ((Rotation) gtk_object_get_data(GTK_OBJECT(cur->data), "rotation_value") & 0xf ))
+         if ((grandr->xr_current_rotation >> (Rotation) gtk_object_get_data(GTK_OBJECT(cur->data), "rotation_value")) & 1)
            gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (cur->data),
                                            TRUE);
          cur = g_slist_next(cur);

It really is obvious, as "rotation_value" is an int between 0 and 3.

I'm attaching a fuller diff that maintains prettier order between the
menu entries. The above is the bug fixer, though.

/Mikael

mån 2005-09-19 klockan 09:26 +0200 skrev Sven Luther:

> On Mon, Sep 19, 2005 at 09:07:27AM +0200, Mikael Nilsson wrote:
> > Package: gnome-randr-applet
> > Version: 0.2-1
> > Severity: important
> >
> >
> > When I've just started Xorg and gnome (on my Dell inspiron 8200 laptop using
> > an nvidia GeForce4 440 Go and nvidia drivers 7667), and check the options in
> > the gnome-randr-applet menu, I get a menu with a lot of resolution options
> > (same as xrandr), and a list of four rotations (same set as xrandr).
>
> Oh fun, i never saw gnome-randr work with anything but resolution changes, as
> xfree86 was not supporting rotations. Will have to have a look, don't have
> time for the next week or so though.
>
> > However, the selected rotation is "Inverted", which is incorrect. This is the output from
> > xrandr:
> >
> > mini@yossarian:~$ xrandr
> >  SZ:    Pixels          Physical       Refresh
> > *0   1600 x 1200   ( 323mm x 242mm )  *60
> >  1   1280 x 1024   ( 323mm x 242mm )   60
> >  2   1024 x 768    ( 323mm x 242mm )   60
> >  3    800 x 600    ( 323mm x 242mm )   60   56
> >  4    640 x 480    ( 323mm x 242mm )   60
> >  5   1400 x 1050   ( 323mm x 242mm )   60
> >  6   1440 x 900    ( 323mm x 242mm )   60
> >  7   1280 x 960    ( 323mm x 242mm )   60
> >  8   1280 x 800    ( 323mm x 242mm )   60
> >  9   1280 x 768    ( 323mm x 242mm )   60
> >  10   960 x 600    ( 323mm x 242mm )   60
> >  11   840 x 525    ( 323mm x 242mm )   60
> >  12   700 x 525    ( 323mm x 242mm )   60
> >  13   640 x 512    ( 323mm x 242mm )   60
> >  14   720 x 450    ( 323mm x 242mm )   60
> >  15   640 x 400    ( 323mm x 242mm )   60
> >  16   640 x 384    ( 323mm x 242mm )   60
> >  17   512 x 384    ( 323mm x 242mm )   60
> >  18   400 x 300    ( 323mm x 242mm )   60   56
> >  19   320 x 240    ( 323mm x 242mm )   60
> > Current rotation - normal
> > Current reflection - none
> > Rotations possible - normal left inverted right
> > Reflections possible - none
> > mini@yossarian:~$
> >
> >
> > The end result is that if I choose another resolution (for doing
> > presentation on external projector), grandr also sets the rotation to
> > inverted... Imagine me standing in front of a crowd full of expectations,
> > only to see my screen upside down ("Oh, well, I'm using Linux" :-).
> >
> > Anyway, I hope there is a simple fix.
>
> Probably, maybe we should ping upstream even.
>
> Friendly,
>
> Sven Luther
>
--
Plus ça change, plus c'est la même chose

rotate.diff (3K) Download Attachment