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 709667 - Rotate OLEDs when the tablet is in left-handed mode
Rotate OLEDs when the tablet is in left-handed mode
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Joaquim Rocha
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-08 18:33 UTC by Bastien Nocera
Modified: 2013-11-20 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wacom: rotate OLED labels on left-handed setups (3.09 KB, patch)
2013-11-19 14:39 UTC, Carlos Garnacho
reviewed Details | Review
wacom: separate LED/OLED setup to a separate function (2.45 KB, patch)
2013-11-19 14:39 UTC, Carlos Garnacho
none Details | Review
wacom: Update pad (O)LEDS when rotation gsetting changes (1.45 KB, patch)
2013-11-19 14:39 UTC, Carlos Garnacho
needs-work Details | Review
wacom: separate LED/OLED setup to a separate function (2.41 KB, patch)
2013-11-19 14:42 UTC, Carlos Garnacho
committed Details | Review
wacom: rotate OLED labels on left-handed setups (3.01 KB, patch)
2013-11-20 16:25 UTC, Carlos Garnacho
committed Details | Review
wacom: Update pad (O)LEDS when rotation gsetting changes (1.14 KB, patch)
2013-11-20 16:25 UTC, Carlos Garnacho
committed Details | Review

Description Bastien Nocera 2013-10-08 18:33:54 UTC
Otherwise the labels are upside-down.
Comment 1 Carlos Garnacho 2013-11-19 14:39:26 UTC
Created attachment 260245 [details] [review]
wacom: rotate OLED labels on left-handed setups

If the tablet is set to left-handed mode, invert the labels so
they look natural with the tablet physically rotated. CW and CCW
modes are also taken into account, so text is always displayed
from top to bottom, even though rotated 90 degrees.
Comment 2 Carlos Garnacho 2013-11-19 14:39:32 UTC
Created attachment 260246 [details] [review]
wacom: separate LED/OLED setup to a separate function

There could be situations where calling this without updating
button mappings is desired.
Comment 3 Carlos Garnacho 2013-11-19 14:39:38 UTC
Created attachment 260247 [details] [review]
wacom: Update pad (O)LEDS when rotation gsetting changes

This is so labels are updated accordingly as soon as the setting
is changed.
Comment 4 Carlos Garnacho 2013-11-19 14:42:52 UTC
Created attachment 260248 [details] [review]
wacom: separate LED/OLED setup to a separate function

There could be situations where calling this without updating
button mappings is desired.
Comment 5 Carlos Garnacho 2013-11-19 14:44:04 UTC
It is worth pointing out that I don't have a tablet with OLEDs at hand, although I double checked that the cairo_surface_t was being created and updated as expected
Comment 6 Bastien Nocera 2013-11-19 14:56:36 UTC
Review of attachment 260245 [details] [review]:

Looks good otherwise.

::: plugins/wacom/gsd-wacom-oled.c
@@ +159,3 @@
 	surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, OLED_WIDTH, OLED_HEIGHT);
 	cr = cairo_create (surface);
+	apply_device_rotation (cr, rotation);

Given that it's 2 lines of code, I'd rather you merged oled_render_text() into here.

@@ +282,3 @@
 	if (g_str_has_prefix (label, MAGIC_BASE64))
 		buffer = g_strdup (label + MAGIC_BASE64_LEN);
+	else {

If you add braces on one branch, please add it to the other as well.
Comment 7 Bastien Nocera 2013-11-19 14:58:25 UTC
Review of attachment 260247 [details] [review]:

You have gvc changes in the patch.

::: plugins/wacom/gsd-wacom-manager.c
@@ +924,3 @@
+			set_rotation (device, g_settings_get_enum (settings, key));
+		else
+			update_pad_leds (device);

Where's update_pad_leds()?
Comment 8 Bastien Nocera 2013-11-19 14:59:01 UTC
Review of attachment 260248 [details] [review]:

Looks good.
Comment 9 Carlos Garnacho 2013-11-19 16:06:25 UTC
(In reply to comment #7)
> Review of attachment 260247 [details] [review]:
> 
> You have gvc changes in the patch.

Oh, I'll make sure that doesn't get in.

> 
> ::: plugins/wacom/gsd-wacom-manager.c
> @@ +924,3 @@
> +            set_rotation (device, g_settings_get_enum (settings, key));
> +        else
> +            update_pad_leds (device);
> 
> Where's update_pad_leds()?

It's in attachment 260248 [details] [review], the order in the bz attachment list got scrambled as I updated and marked the former patch obsolete soon after
Comment 10 Carlos Garnacho 2013-11-19 16:15:43 UTC
(In reply to comment #6)
> Review of attachment 260245 [details] [review]:
> 
> ::: plugins/wacom/gsd-wacom-oled.c
> @@ +159,3 @@
>      surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, OLED_WIDTH,
> OLED_HEIGHT);
>      cr = cairo_create (surface);
> +    apply_device_rotation (cr, rotation);
> 
> Given that it's 2 lines of code, I'd rather you merged oled_render_text() into
> here.
> 

I'm not sure what you mean here, should I fold apply_device_rotation() into oled_render_text(), or do you mean I should merge oled_render_text() into oled_encode_image()?
Comment 11 Bastien Nocera 2013-11-20 09:12:28 UTC
apply_device_rotation() into oled_render_text().
Comment 12 Carlos Garnacho 2013-11-20 16:25:13 UTC
Created attachment 260338 [details] [review]
wacom: rotate OLED labels on left-handed setups

If the tablet is set to left-handed mode, invert the labels so
they look natural with the tablet physically rotated. CW and CCW
modes are also taken into account, so text is always displayed
from top to bottom, even though rotated 90 degrees.
Comment 13 Carlos Garnacho 2013-11-20 16:25:17 UTC
Created attachment 260339 [details] [review]
wacom: Update pad (O)LEDS when rotation gsetting changes

This is so labels are updated accordingly as soon as the setting
is changed.
Comment 14 Bastien Nocera 2013-11-20 16:56:23 UTC
Review of attachment 260338 [details] [review]:

Looks good otherwise.

::: plugins/wacom/gsd-wacom-oled.c
@@ +272,1 @@
 	if (g_str_has_prefix (label, MAGIC_BASE64))

You're still missing the braces here, as you add some to the other branch of the conditional.
Comment 15 Bastien Nocera 2013-11-20 16:57:02 UTC
Review of attachment 260339 [details] [review]:

Sure.
Comment 16 Carlos Garnacho 2013-11-20 17:13:53 UTC
(In reply to comment #14)
> You're still missing the braces here, as you add some to the other branch of
> the conditional.

Right, I forgot that change... Both patches are now pushed with that change applied.