Commit Graph
708 Commits
Author SHA1 Message Date
Tor Hedin Brønner 94de302b22 Fix adding new workspaces
Adding a new workspace would obscure the active workspace.
2018-05-26 15:17:47 +02:00
Tor Hedin Brønner 5b12b44fb7 Prevent crash when removing workspaces
If the workspace is removed workspace.index() causes a crash...
2018-05-26 15:10:32 +02:00
Tor Hedin Brønner 3e6843ca1a Fix selection visibility
Always show the selection chrome on new windows, and always hide it when there's
no windows left.
2018-05-25 18:21:46 +02:00
Tor Hedin Brønner 6094bd46f8 Bind <Super>Up to toggleMaximizeHorizontally 2018-05-24 18:15:22 +02:00
Tor Hedin Brønner 7c70da6e66 Bind <Super>Right/Left to switch-next/previous
Don't think it's possible to rebind these keys on disable.
2018-05-24 17:52:59 +02:00
Tor Hedin Brønner 3d0fa30f37 Fix weird typo 2018-05-23 03:14:00 +02:00
Tor Hedin Brønner 170df6ba34 minimap: Use whole pixel values consistently 2018-05-21 22:31:14 +02:00
Ole Jørgen Brønner 33a365f326 Handle gnome-terminal specially in newWindow
Invoking `app.open_new_window` on gnome-terminal does not inherit $PWD. We want
that so take matter into our own hands.

Note: vte.sh must be sourced in the terminal's shell.

Other approaches:

Write a custom .desktop file where "Exec" is a custom script (Note that it's
probably not possible to call the dbus action using dbus-send or qdbus due to
the argument structure)

I tried to use the dbus interface directly from js too, but it seems basically
impossible to call correctly..

  const Gio = imports.gi.Gio;
  const GLib = imports.gi.GLib;
  Gio.DBus.session.call(
      metaWindow.gtk_unique_bus_name,
      metaWindow.gtk_window_object_path,
      "org.gtk.Actions",
      "Activate",
      GLib.Variant.new_tuple([
          new GLib.Variant("s", "new-terminal"),
          GLib.Variant.new_array(null,
             [new GLib.Variant('(ss)', ["window", "current"])]),
          GLib.Variant.new_array(new GLib.VariantType("{sv}"), [])
      ]),
      null, Gio.DBusCallFlags.NONE, -1, null,
      (conn, result) => {}
   );

Complains about wrong type - wants the first array to be "av", not "a(ss)", but
I don't know how to create a "opaque" variant..

Keywords: current directory
2018-05-21 14:32:06 +02:00
Ole Jørgen Brønner 1bc2075e84 Display notification on errors in user.js 2018-05-20 17:24:23 +02:00
Ole Jørgen Brønner dea5cb958d Minor future proofing: Replace all '-' occurrences (not just the first) 2018-05-20 13:23:56 +02:00
Ole Jørgen Brønner 2aa1f84b33 Bugfix: Canceling navigator didn't return to focused window
Regression after a8efb66aa5
2018-05-17 22:59:47 +02:00
Ole Jørgen Brønner b703bbb0b0 Bugfix: fixStack not always called when window receives focus
The primary symptom is that the wrong window is focused next when the current
window is closed. Most easily triggered by quickly letting <super> go when
navigation to the window (from far away).

I'm not sure why the fixStack call was conditioned in the first place?

Probably regression after: 8d3ae51728
2018-05-17 22:24:12 +02:00
Ole Jørgen Brønner acb383249e Minor cleanup 2018-05-17 14:18:43 +02:00
Tor Hedin Brønner 7012fbb6a2 readme: Document the workspace menu 2018-05-16 17:51:40 +02:00
Tor Hedin Brønner 6d55fbe3e4 Better fix for initial space.label positioning
Hide the label at space construction. Update and show the label when before we
start looking at the workspace mru stack.

Also use the position of the menu label relative to the panelbox, to support
placing the workspace menu in eg. the center.
2018-05-16 15:44:27 +02:00
Tor Hedin Brønner f4c6e057a9 If there's not enough colors in worspace-colors fill it up with '' 2018-05-15 22:37:17 +02:00
Tor Hedin Brønner ccbd44e3ff workspace menu: Always update the text color
We need to connect the Ste.Entry.clutter_text actor here.
2018-05-15 22:37:17 +02:00
Ole Jørgen Brønner 11a37af93d Create and destroy workspace menu on enable/disable
Lack of super.destroy() in WorkspaceMenu.destroy likely prevented previous
attempts from working properly.
2018-05-15 22:37:17 +02:00
Ole Jørgen Brønner 44237287f0 "Accept" PopupMenuEntry on <Return> (eg. set workspace name) 2018-05-15 22:37:17 +02:00
Ole Jørgen Brønner 5b60380d16 Handle renaming n'th workspace when (n-k)'th workspace doesn't have a name 2018-05-15 22:37:17 +02:00
Tor Hedin Brønner 88c11dadfe Add workspace menu with name and color selection 2018-05-15 22:37:17 +02:00
Tor Hedin Brønner e0f2d4b12b Fix stupid typo 2018-05-15 19:58:09 +02:00
Tor Hedin Brønner 6942df947f Monitor preference changes
Introduces `prefs.js` with simple `settings::change` signal handling.

Also put workspace colors in the schema and draw them from there.
2018-05-15 16:31:01 +02:00
Tor Hedin Brønner 846cbacffc readme: Document close keybinding 2018-05-14 15:28:09 +02:00
Tor Hedin Brønner d23ae6f7ac Use custom handler for extra close methods
This avoids overriding the default close binding (alt-f4).
2018-05-14 15:22:57 +02:00
Tor Hedin Brønner ed054062df Use window_manager::switch-workspace instead of screen::workspace-switched
The former happens earlier so is probably a better fit.
2018-05-13 13:07:41 +02:00
Tor Hedin Brønner 08ba7c89df bindings: Use a custom handler on restore-shortcuts
Haven't looked at restoration at disable, but this will at least restore things
on restart.

Also remove killKeybinding and restoreKeybindings as they worked out really
badly.
2018-05-11 15:45:19 +02:00
Tor Hedin Brønner 48eac9081b new window: Use correct coordinates for initial clone position 2018-05-11 14:00:12 +02:00
Tor Hedin Brønner 000881524a New minimap
Simple switcherlist styled minimap without any animations.

TODO: add fading at the edges
2018-05-10 22:30:40 +02:00
Tor Hedin Brønner 3ff6570344 Fix selection highlight and reset visible windows on window-removed
Fixes the behavior of closing the last window in a workspace, where the
selection highlight would hang around. Navigating away from the workspace would
leave an empty minimap and require another keypress to make the intended action.
2018-05-10 22:30:40 +02:00
Tor Hedin Brønner 5a9663bce8 Ugly fix for label position 2018-05-09 23:55:09 +02:00
Tor Hedin Brønner 7bda057d6f Actually destroy the minimap actor
This might've been the cause of a performance bug.
2018-05-08 19:55:58 +02:00
Tor Hedin Brønner ba5db56c9d Always show the window selection chrome 2018-05-08 15:27:00 +02:00
Tor Hedin Brønner 24ee62d5c9 Make startup somewhat less noisy 2018-05-08 15:27:00 +02:00
Tor Hedin Brønner 44c8ff4f93 readme: Document winprops 2018-05-08 14:36:39 +02:00
Tor Hedin Brønner 0ed309fa18 Use 'tile-preview' style for selected window highlight
Might be a bit subtle, but works better as a selection, as there's a background
color (somewhat transparent).

We position the highlight vertically from the bottom of the top bar to the
bottom of the monitor.
2018-05-08 13:32:32 +02:00
Tor Hedin Brønner 829d992b59 Highlight selected windows when browsing the workspace mru stack 2018-05-08 12:19:09 +02:00
Tor Hedin Brønner 8dd4fcb82d ClickOverlay: Use button-press-event to activate windows
More reponsive than release
2018-05-08 12:19:09 +02:00
Tor Hedin Brønner a8efb66aa5 Force ensure on all workspace switches
Also don't emit 'move-done' if we've looked in the workspace stack.
2018-05-08 12:19:09 +02:00
Tor Hedin Brønner b236636af5 Increase the cloneContainer clip and background size 2018-05-08 12:19:09 +02:00
Tor Hedin Brønner e2f0b84ce7 Only create a single minimap 2018-05-07 14:15:47 +02:00
Tor Hedin Brønner ff4c7180ba navigator: Use the space mru to navigate workspaces
Access the spaces using a straight mru list, instead of through the awkward
`multimap.minimaps[i].space`.

Also move the rest of `_init` into `_initialSelection`, leaving the absolutely
bare minimum (`_switcherList` is required before `_initialSelection` is run).
2018-05-07 14:14:06 +02:00
Tor Hedin Brønner 05111f1266 Remove ugly early return when the space isn't fully filled up 2018-05-07 14:14:06 +02:00
Tor Hedin Brønner 46203848d9 Add selected window highlight 2018-05-07 13:47:54 +02:00
Tor Hedin Brønner 0f086909fe Actually fix new window animation
In the case a new window didn't already receive focus, giving it focus after
having moved the frame would immediately show the WindowActor.

Instead we always run ensure with force on new windows, marking them as moving.
Making it unnecessary to add special handling in the focus handler for new
windows.
2018-05-06 13:39:17 +02:00
Tor Hedin Brønner 2d9c425b22 Fix new window animation regression
Calling ensure without force made the WindowActor immediately show itself, which
killed off the animation of the clone.
2018-05-06 12:48:28 +02:00
Tor Hedin Brønner 711fc67229 navigator: Remove obsolete code 2018-05-05 13:21:36 +02:00
Tor Hedin Brønner e521865888 ensureViewport: Don't animate if we're not moving the window 2018-05-05 13:21:36 +02:00
Tor Hedin Brønner fb4dfd1985 Let the Space::move-done signal take care of showing WindowActors
We store windows that should be visible, ie. their WindowActor should be shown,
in a `Space.visible` array. When done with animation we emit `move-done` and the
space will take care of replacing the clones with WindowActors.

Navigator integration is a bit awkward as we simply rely on a `Space.delay` to
indicate if we're in a non-moving state and can commit the WindowActors
immediately when finishing a navigation.
2018-05-05 13:21:35 +02:00
Tor Hedin Brønner 0a0812eaa1 Top bar: set correct space label position
Also use bold style for the workspace label to match the style of the top bar.
2018-05-05 13:21:35 +02:00