ubuntu, unity, usability

Standard

some people just can’t be pleased…

diff -uPr a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt    2016-09-07 00:17:02.000000000 +0100
+++ b/CMakeLists.txt    2016-10-01 15:52:04.672948670 +0100
@@ -29,7 +29,7 @@
 option(
   ENABLE_UNIT_TESTS
   "Enable Unity Unit Tests"
-  ON
+  OFF
 )

 # This is due to bug lp:668799 - qemu-arm segfaults executing msgmerge
diff -uPr a/data/com.canonical.Unity.gschema.xml b/data/com.canonical.Unity.gschema.xml
--- a/data/com.canonical.Unity.gschema.xml  2016-09-07 00:17:02.000000000 +0100
+++ b/data/com.canonical.Unity.gschema.xml  2016-10-01 12:06:33.642424463 +0100
@@ -229,7 +229,7 @@
   </schema>
   <schema path="/com/canonical/unity/gestures/" id="com.canonical.Unity.Gestures" gettext-domain="unity">
     <key type="b" name="launcher-drag">
-      <default>true</default>
+      <default>false</default>
       <summary>Multi-touch gesture to reveal the launcher.</summary>
       <description>When this is enabled, a 4 finger swipe from left to right will reveal launcher,
         provided that the launcher is set to auto-hide.</description>
diff -uPr a/launcher/Launcher.cpp b/launcher/Launcher.cpp
--- a/launcher/Launcher.cpp 2016-09-07 00:17:02.000000000 +0100
+++ b/launcher/Launcher.cpp 2016-10-01 13:47:04.931512941 +0100
@@ -1312,7 +1312,7 @@

 LauncherHideMode Launcher::GetHideMode() const
 {
-  return options()->hide_mode;
+  return LAUNCHER_HIDE_AUTOHIDE;
 }

 /* End Launcher Show/Hide logic */
@@ -1330,22 +1330,7 @@

 void Launcher::OnMonitorChanged(int new_monitor)
 {
-  UScreen* uscreen = UScreen::GetDefault();
-  auto monitor_geo = uscreen->GetMonitorGeometry(new_monitor);
-  unity::panel::Style &panel_style = panel::Style::Instance();
-  int panel_height = panel_style.PanelHeight(new_monitor);
-  RawPixel launcher_height = icon_size_ + ICON_PADDING * 2 + SIDE_LINE_WIDTH - 2;
-  cv_ = unity::Settings::Instance().em(monitor);
-  launcher_height = launcher_height.CP(cv_) - (1_em).CP(cv_);
-
-  if (launcher_position_ == LauncherPosition::LEFT)
-    Resize(nux::Point(monitor_geo.x, monitor_geo.y + panel_height), monitor_geo.height - panel_height);
-  else
-    Resize(nux::Point(monitor_geo.x, monitor_geo.y + monitor_geo.height - launcher_height), monitor_geo.width);
-
-  icon_renderer_->monitor = new_monitor;
-  icon_renderer_->scale = cv_->DPIScale();
-  SetIconSize(options()->tile_size, options()->icon_size);
+  return;
 }

 void Launcher::UpdateOptions(Options::Ptr options)
@@ -1377,9 +1362,9 @@

 void Launcher::SetHideMode(LauncherHideMode hidemode)
 {
-  bool fixed_launcher = (hidemode == LAUNCHER_HIDE_NEVER);
+  bool fixed_launcher = false;
   parent_->InputWindowEnableStruts(fixed_launcher);
-  hide_machine_.SetMode(static_cast<LauncherHideMachine::HideMode>(hidemode));
+  hide_machine_.SetMode(static_cast<LauncherHideMachine::HideMode>(LAUNCHER_HIDE_AUTOHIDE));
 }

 BacklightMode Launcher::GetBacklightMode() const
@@ -1673,31 +1658,12 @@

 int Launcher::GetIconSize() const
 {
-  return icon_size_.CP(cv_);
+  return 0;
 }

 void Launcher::Resize(nux::Point const& offset, int size)
 {
-  RawPixel width = 0, height = 0;
-  if (launcher_position_ == LauncherPosition::LEFT)
-  {
-    width = icon_size_ + ICON_PADDING * 2 + SIDE_LINE_WIDTH - 2;
-    width = width.CP(cv_);
-    height = size;
-    SetMaximumHeight(height);
-  }
-  else
-  {
-    height = icon_size_ + ICON_PADDING * 2 + SIDE_LINE_WIDTH - 2;
-    height = height.CP(cv_);
-    width = size;
-    SetMaximumWidth(width);
-  }
-
-  SetGeometry(nux::Geometry(0, 0, width, height));
-  parent_->SetGeometry(nux::Geometry(offset.x, offset.y, width, height));
-
-  ConfigureBarrier();
+  return;
 }

 void Launcher::OnIconNeedsRedraw(AbstractLauncherIcon::Ptr const& icon, int icon_monitor)
@@ -1824,280 +1790,7 @@

 void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
 {
-  nux::Geometry const& base = GetGeometry();
-  nux::Geometry bkg_box;
-  std::list<RenderArg> args;
-  std::list<RenderArg>::reverse_iterator rev_it;
-  float launcher_alpha = 1.0f;
-
-  nux::ROPConfig ROP;
-  ROP.Blend = false;
-  ROP.SrcBlend = GL_ONE;
-  ROP.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
-
-  bool force_show_window;
-  nux::Geometry const& geo_absolute = GetAbsoluteGeometry();
-  RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute, force_show_window);
-
-  if (launcher_position_ == LauncherPosition::LEFT)
-    bkg_box.width -= SIDE_LINE_WIDTH.CP(cv_);
-  else
-    bkg_box.height -= SIDE_LINE_WIDTH.CP(cv_);
-
-  if (options()->hide_mode != LAUNCHER_HIDE_NEVER &&
-      bkg_box.x + bkg_box.width <= 0 &&
-      hide_machine_.reveal_progress <= 0 &&
-      !force_show_window)
-  {
-    parent_->ShowWindow(false);
-  }
-
-  nux::Color clear_colour = nux::Color(0x00000000);
-
-  // clear region
-  GfxContext.PushClippingRectangle(base);
-  gPainter.PushDrawColorLayer(GfxContext, base, clear_colour, true, ROP);
-
-  if (Settings::Instance().low_gfx() == false)
-  {
-    GfxContext.GetRenderStates().SetBlend(true);
-    GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
-    GfxContext.GetRenderStates().SetColorMask(true, true, true, true);
-  }
-
-  int push_count = 1;
-
-  if (launcher_position_ == LauncherPosition::LEFT)
-    GfxContext.PushClippingRectangle(nux::Geometry(base.x, bkg_box.y, base.width, bkg_box.height));
-  else
-    GfxContext.PushClippingRectangle(nux::Geometry(bkg_box.x, base.y, bkg_box.width, base.height));
-
-  float reveal_progress = hide_machine_.reveal_progress;
-
-  if ((reveal_progress > 0 || last_reveal_progress_ > 0) && launcher_pressure_effect_.IsValid())
-  {
-    if (std::abs(last_reveal_progress_ - reveal_progress) <= .1f)
-    {
-      last_reveal_progress_ = reveal_progress;
-    }
-    else
-    {
-      if (last_reveal_progress_ > reveal_progress)
-        last_reveal_progress_ -= .1f;
-      else
-        last_reveal_progress_ += .1f;
-    }
-    nux::Color pressure_color = nux::color::White * last_reveal_progress_;
-    nux::TexCoordXForm texxform_pressure;
-
-    int pressure_y = 0, pressure_width = 0, pressure_height = 0;
-    if (launcher_position_ == LauncherPosition::LEFT)
-    {
-      pressure_y = base.y;
-      pressure_width = launcher_pressure_effect_->GetWidth();
-      pressure_height = base.height;
-    }
-    else
-    {
-      pressure_y = base.y + base.height - SIDE_LINE_WIDTH.CP(cv_) - launcher_pressure_effect_->GetHeight();
-      pressure_width = base.width;
-      pressure_height = launcher_pressure_effect_->GetHeight();
-    }
-
-    GfxContext.QRP_1Tex(base.x, pressure_y, pressure_width, pressure_height,
-                        launcher_pressure_effect_->GetDeviceTexture(),
-                        texxform_pressure,
-                        pressure_color);
-  }
-
-  if (!Settings::Instance().low_gfx())
-  {
-    if (IsOverlayOpen() && bg_effect_helper_.enabled)
-    {
-      nux::ObjectPtr<nux::IOpenGLBaseTexture> blur_texture;
-
-      bool visible = false;
-      if ((launcher_position_ == LauncherPosition::LEFT && (bkg_box.x + bkg_box.width > 0)) ||
-          (launcher_position_ == LauncherPosition::BOTTOM && (bkg_box.y < bkg_box.height)))
-        visible = true;
-
-      if (BackgroundEffectHelper::blur_type != unity::BLUR_NONE && visible)
-      {
-        blur_texture = bg_effect_helper_.GetBlurRegion();
-      }
-      else
-      {
-        blur_texture = bg_effect_helper_.GetRegion();
-      }
-
-      if (blur_texture.IsValid())
-      {
-        nux::TexCoordXForm texxform_blur_bg;
-        texxform_blur_bg.flip_v_coord = true;
-        texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
-        texxform_blur_bg.uoffset = ((float) base.x) / geo_absolute.width;
-        texxform_blur_bg.voffset = ((float) base.y) / geo_absolute.height;
-
-        GfxContext.PushClippingRectangle(bkg_box);
-
-#ifndef NUX_OPENGLES_20
-        if (GfxContext.UsingGLSLCodePath())
-        {
-          gPainter.PushDrawCompositionLayer(GfxContext, base,
-                                            blur_texture,
-                                            texxform_blur_bg,
-                                            nux::color::White,
-                                            options()->background_color, nux::LAYER_BLEND_MODE_OVERLAY,
-                                            true, ROP);
-        }
-        else
-        {
-          gPainter.PushDrawTextureLayer(GfxContext, base,
-                                        blur_texture,
-                                        texxform_blur_bg,
-                                        nux::color::White,
-                                        true,
-                                        ROP);
-        }
-#else
-        gPainter.PushDrawCompositionLayer(GfxContext, base,
-                                          blur_texture,
-                                          texxform_blur_bg,
-                                          nux::color::White,
-                                          options()->background_color, nux::LAYER_BLEND_MODE_OVERLAY,
-                                          true, ROP);
-#endif
-        GfxContext.PopClippingRectangle();
-
-        push_count++;
-      }
-
-      unsigned int alpha = 0, src = 0, dest = 0;
-      GfxContext.GetRenderStates().GetBlend(alpha, src, dest);
-
-      // apply the darkening
-      GfxContext.GetRenderStates().SetBlend(true, GL_ZERO, GL_SRC_COLOR);
-      gPainter.Paint2DQuadColor(GfxContext, bkg_box, nux::Color(0.9f, 0.9f, 0.9f, 1.0f));
-      GfxContext.GetRenderStates().SetBlend (alpha, src, dest);
-
-      // apply the bg colour
-#ifndef NUX_OPENGLES_20
-      if (GfxContext.UsingGLSLCodePath() == false)
-        gPainter.Paint2DQuadColor(GfxContext, bkg_box, options()->background_color);
-#endif
-
-      // apply the shine
-      GfxContext.GetRenderStates().SetBlend(true, GL_DST_COLOR, GL_ONE);
-      nux::TexCoordXForm texxform;
-      texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
-      texxform.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP);
-      texxform.uoffset = (1.0f / launcher_sheen_->GetWidth()); // TODO (gord) don't use absolute values here
-      texxform.voffset = (1.0f / launcher_sheen_->GetHeight()) * panel::Style::Instance().PanelHeight(icon_renderer_->monitor);
-      GfxContext.QRP_1Tex(base.x, base.y, base.width, base.height,
-                          launcher_sheen_->GetDeviceTexture(),
-                          texxform,
-                          nux::color::White);
-
-      //reset the blend state
-      GfxContext.GetRenderStates().SetBlend (alpha, src, dest);
-    }
-    else
-    {
-      nux::Color color = options()->background_color;
-      color.alpha = options()->background_alpha;
-      gPainter.Paint2DQuadColor(GfxContext, bkg_box, color);
-    }
-  }
-  else
-  {
-    nux::Color color = options()->background_color;
-    color.alpha = 1.0f;
-    gPainter.Paint2DQuadColor(GfxContext, bkg_box, color);
-  }
-
-  GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
-
-  // XXX: It would be very cool to move the Rendering part out of the drawing part
-  icon_renderer_->PreprocessIcons(args, base);
-  EventLogic();
-
-
-  /* draw launcher */
-  for (rev_it = args.rbegin(); rev_it != args.rend(); ++rev_it)
-  {
-    if ((*rev_it).stick_thingy)
-    {
-      if (launcher_position_ == LauncherPosition::LEFT)
-        gPainter.Paint2DQuadColor(GfxContext,
-                                  nux::Geometry(bkg_box.x, (*rev_it).render_center.y - 3, bkg_box.width, 2),
-                                  nux::Color(0xAAAAAAAA));
-      else
-        gPainter.Paint2DQuadColor(GfxContext,
-                                  nux::Geometry((*rev_it).render_center.x - 3, bkg_box.y, 2, bkg_box.height),
-                                  nux::Color(0xAAAAAAAA));
-    }
-
-    if ((*rev_it).skip)
-      continue;
-
-    icon_renderer_->RenderIcon(GfxContext, *rev_it, bkg_box, base);
-  }
-
-  if (!IsOverlayOpen() && launcher_position_ == LauncherPosition::LEFT)
-  {
-    const double right_line_opacity = 0.15f * launcher_alpha;
-
-    gPainter.Paint2DQuadColor(GfxContext,
-                              nux::Geometry(bkg_box.x + bkg_box.width,
-                                            bkg_box.y,
-                                            SIDE_LINE_WIDTH.CP(cv_),
-                                            bkg_box.height),
-                              nux::color::White * right_line_opacity);
-
-    gPainter.Paint2DQuadColor(GfxContext,
-                              nux::Geometry(bkg_box.x,
-                                            bkg_box.y,
-                                            bkg_box.width,
-                                            8),
-                              nux::Color(0x70000000),
-                              nux::Color(0x00000000),
-                              nux::Color(0x00000000),
-                              nux::Color(0x70000000));
-  }
-
-  if (!IsOverlayOpen() && launcher_position_ == LauncherPosition::BOTTOM)
-  {
-    const double top_line_opacity = 0.15f * launcher_alpha;
-
-    gPainter.Paint2DQuadColor(GfxContext,
-                              nux::Geometry(bkg_box.x,
-                                            bkg_box.y,
-                                            bkg_box.width,
-                                            SIDE_LINE_WIDTH.CP(cv_)),
-                              nux::color::White * top_line_opacity);
-
-    gPainter.Paint2DQuadColor(GfxContext,
-                              nux::Geometry(bkg_box.x,
-                                            bkg_box.y,
-                                            bkg_box.width,
-                                            8),
-                              nux::Color(0x70000000),
-                              nux::Color(0x00000000),
-                              nux::Color(0x00000000),
-                              nux::Color(0x70000000));
-  }
-
-  // FIXME: can be removed for a bgk_box->SetAlpha once implemented
-  GfxContext.GetRenderStates().SetPremultipliedBlend(nux::DST_IN);
-  nux::Color alpha_mask = nux::Color(0xFFAAAAAA) * launcher_alpha;
-  gPainter.Paint2DQuadColor(GfxContext, bkg_box, alpha_mask);
-
-  GfxContext.GetRenderStates().SetColorMask(true, true, true, true);
-  GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
-
-  gPainter.PopBackground(push_count);
-  GfxContext.PopClippingRectangle();
-  GfxContext.PopClippingRectangle();
+    return;
 }

 long Launcher::PostLayoutManagement(long LayoutResult)
diff -uPr a/launcher/LauncherOptions.cpp b/launcher/LauncherOptions.cpp
--- a/launcher/LauncherOptions.cpp  2016-09-07 00:17:02.000000000 +0100
+++ b/launcher/LauncherOptions.cpp  2016-10-01 13:25:04.501922065 +0100
@@ -32,10 +32,10 @@
   , urgent_animation(URGENT_ANIMATION_WIGGLE)
   , auto_hide_animation(FADE_AND_SLIDE)
   , backlight_mode(BACKLIGHT_NORMAL)
-  , reveal_trigger(RevealTrigger::EDGE)
+  , reveal_trigger(RevealTrigger::CORNER)
   , background_color(nux::Color(95, 18, 45))
   , background_alpha(0.6667)
-  , icon_size(48)
+  , icon_size(0)
   , tile_size(54)
   , super_tap_duration(250)
   , edge_decay_rate(1500)
Only in a
diff -uPr a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in
--- a/plugins/unityshell/unityshell.xml.in  2016-09-07 00:17:02.000000000 +0100
+++ b/plugins/unityshell/unityshell.xml.in  2016-10-01 12:06:33.646424379 +0100
@@ -240,7 +240,7 @@
                     <_short>Key to show the Dash, Launcher and Help Overlay</_short>
                     <_long>Holding this key makes the Launcher and Help Overlay appear. Tapping it opens the Dash.</_long>
                     <tap_detection>false</tap_detection>
-                    <default><Super></default>
+                    <default>Disabled</default>
                 </option>

                 <option name="keyboard_focus" type="key">
@@ -283,7 +283,7 @@
                     <_long>Make the Launcher hide automatically after some time of inactivity.</_long>
                     <min>0</min>
                     <max>1</max>
-                    <default>0</default>
+                    <default>1</default>
                     <desc>
                         <value>0</value>
                         <_name>Never</_name>
@@ -323,7 +323,7 @@
                     <_long></_long>
                     <min>0</min>
                     <max>1</max>
-                    <default>0</default>
+                    <default>1</default>
                     <desc>
                         <value>0</value>
                         <_name>Left Edge</_name>
@@ -353,7 +353,7 @@
                 <option name="launcher_capture_mouse" type="bool">
                     <_short>Launcher Capture Mouse</_short>
                     <_long>Determines if the Launcher's edges will capture the mousepointer.</_long>
-                    <default>true</default>
+                    <default>false</default>
                 </option>

                 <option name="scroll_inactive_icons" type="bool">
@@ -371,8 +371,8 @@
                 <option name="edge_responsiveness" type="float">
                     <_short>Launcher Reveal Edge Responsiveness</_short>
                     <_long>A conglomerate setting that modifies the overall responsiveness of the Launcher reveal.</_long>
-                    <default>2.0</default>
-                    <min>0.2</min>
+                    <default>0.0</default>
+                    <min>0.0</min>
                     <max>8.0</max>
                     <precision>0.1</precision>
                 </option>
@@ -425,8 +425,8 @@
                 <option name="icon_size" type="int">
                     <_short>Launcher Icon Size</_short>
                     <_long>The size of the icons in the Launcher.</_long>
-                    <default>48</default>
-                    <min>8</min>
+                    <default>0</default>
+                    <min>0</min>
                     <max>64</max>
                     <precision>1</precision>
                 </option>
@@ -464,7 +464,7 @@
                     <_long>The icon animation playing during the launch of a process.</_long>
                     <min>0</min>
                     <max>2</max>
-                    <default>1</default>
+                    <default>0</default>
                     <desc>
                         <value>0</value>
                         <_name>None</_name>
@@ -484,7 +484,7 @@
                     <_long>The icon animation playing when a Launcher Icon is in the urgent state.</_long>
                     <min>0</min>
                     <max>2</max>
-                    <default>2</default>
+                    <default>0</default>
                     <desc>
                         <value>0</value>
                         <_name>None</_name>
diff -uPr a/unity-shared/UnitySettings.cpp b/unity-shared/UnitySettings.cpp
--- a/unity-shared/UnitySettings.cpp    2016-09-07 00:17:02.000000000 +0100
+++ b/unity-shared/UnitySettings.cpp    2016-10-01 12:13:21.684746346 +0100
@@ -72,7 +72,7 @@
 const std::string DASH_TAP = "dash-tap";
 const std::string WINDOWS_DRAG_PINCH = "windows-drag-pinch";

-const int DEFAULT_LAUNCHER_SIZE = 64;
+const int DEFAULT_LAUNCHER_SIZE = 0;
 const int MINIMUM_DESKTOP_HEIGHT = 800;
 const int GNOME_SETTINGS_CHANGED_WAIT_SECONDS = 1;
 const double DEFAULT_DPI = 96.0f;
@@ -473,7 +473,7 @@
   }
   else
   {
-    pimpl->launcher_sizes_[monitor] = launcher_size;
+    pimpl->launcher_sizes_[monitor] = 0;
   }
 }

h/t: jtld‘s self-answered question on askubuntu.com

  • the patch above works with yakkety’s unity 7.5, and with a small change to the path of com.canonical.Unity.gschema.xml will also apply cleanly on xenial’s unity 7.4,
  • ’tis a butchery, of course, nothing subtle, nothing proper, works for me; ymmv

less is more or usable clickpad

Aside

One of the unfair advantages of Apple hardware is the quality of their touchpads.

The synaptics clickpad in my yoga 2 ain’t Apple-quality, that’s for sure. It’s still quite nice to use, though, but the default configuration is pretty conservative. Here’s what makes it working for me on xenial with x11:

  • The libinput driver. Tweaking the synaptics one is an interesting exercise if one has hours for experimentation, but, ultimately, one will fail. So, let’s get rid of synaptics and make sure it’s libinput (requires X11 session restart):
sudo apt purge xserver-xorg-input-synaptics
sudo apt install xserver-xorg-input-libinput
  • No soft buttons. Soft buttons are evil. One-, two- and three-finger clicks are fine. Also, tapping is good.
#!/usr/bin/env bash

xinput --set-prop "SynPS/2 Synaptics TouchPad" "libinput Click Method Enabled" 0 1
xinput --set-prop "SynPS/2 Synaptics TouchPad" "libinput Tapping Enabled" 1

(I’m lazy, so this gets executed on every login instead of being put into an X11 configuration snippet.)

go the fuck to sleep

Aside

intro, where complaints are made excessively

Note: this short article in no way criticises systemd. It’s not systemd's fault, that – while it provides a nice framework for managing various power states – it does not come with any built-in functionality besides bare kernel interface. If that works for you and you don’t need to handle any quirks of your hardware, you don’t need this article.

But I digress. Until systemd's suspend and hibernate will provide the same functionality as pm-utils, one might just want to tell systemd to use pm-utils. It’s easy enough to do.

the actual part where things are described

Disclaimer: I take no responsibility for any damage this might do to any system. I’m assuming that the reader knows what they’re doing and are reasonably familiar with command line interface and systemd.

First, let’s install pm-utils. On Debian-based systems apt-get install pm-utils will do nicely.

Second, let’s locate the relevant service files. On Debian-based systems one or more of the following files should do:

/lib/systemd/system/systemd-hibernate.service
/lib/systemd/system/systemd-hybrid-sleep.service
/lib/systemd/system/systemd-suspend.service

As I’m not using hibernation or hybrid sleep, I’ve decided to override only the suspend service so I’ve put the following into /etc/systemd/system/systemd-suspend.service:

#  Use pm-utils instead of systemd-sleep

[Unit]
Description=Suspend
Documentation=man:pm-suspend(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/pm-suspend

The only relevant change here is to replace the systemd-sleep binary in the ExecStart= stanza with pm-suspend.

Reloading the systemd configuration (systemd daemon-reload) or restarting it (systemd daemon-reexec) should do the trick. (One could probably also use systemctl edit systemd-suspend.service, but I’m new to this whole systemd thingy.)

(Note: this is a shortcut. It’s absolutely possible to port all functionality of pm-utils to use the framework provided by systemd – I just haven’t had enough time to do that. See systemd-sleep(8) and systemd-sleep.conf(5) manpages for more information.)