[PATCH weston 2/2] desktop-shell: Support panel-position 'none'

Daniel Stone daniel at fooishbar.org
Mon Jan 16 15:15:07 UTC 2017


Hi,

On 16 January 2017 at 15:12, Quentin Glidic
<sardemff7+wayland at sardemff7.net> wrote:
> Hey, didn’t it work already? A tiny warning is no big. ;-)

Nope, it warned and then left the panel on the left.

> Anyway:
> Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>

Thanks! Pushed both, and your manpage fix:
To ssh://git.freedesktop.org/git/wayland/weston
   9cbe1c6..46ffea6  push -> master

>>   {
>>         char *position;
>>   +     desktop->want_panel = 1;
>> +
>>         weston_config_section_get_string(s, "panel-position", &position,
>> "top");
>> -       if (strcmp(position, "top") == 0)
>> +       if (strcmp(position, "top") == 0) {
>>                 desktop->panel_position =
>> WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP;
>> -       else if (strcmp(position, "bottom") == 0)
>> +       } else if (strcmp(position, "bottom") == 0) {
>>                 desktop->panel_position =
>> WESTON_DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
>> -       else if (strcmp(position, "left") == 0)
>> +       } else if (strcmp(position, "left") == 0) {
>>                 desktop->panel_position =
>> WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT;
>> -       else if (strcmp(position, "right") == 0)
>> +       } else if (strcmp(position, "right") == 0) {
>>                 desktop->panel_position =
>> WESTON_DESKTOP_SHELL_PANEL_POSITION_RIGHT;
>> -       else
>
>
> Style question: why not just strcmp(position, "none") != 0 as another else
> if?

No particular reason. I started with that initially, went back and
forth a couple of times, and landed on this as the most compact.
*shrug*

Cheers,
Daniel


More information about the wayland-devel mailing list