diff --git a/extension.js b/extension.js index fb4c975..1cfd83b 100644 --- a/extension.js +++ b/extension.js @@ -28,6 +28,7 @@ let config = { useMaximize: true, debug: true, preview: { + enabled: true, close: 75, delay: 500 } @@ -48,6 +49,7 @@ let settings = new Gio.Settings({ function updateSettings() { config.cols = (settings.get_value('cols').deep_unpack())+2; config.useMaximize = settings.get_value('use-maximize').deep_unpack(); + config.preview.enabled = settings.get_value('preview').deep_unpack(); config.debug = settings.get_value('debug').deep_unpack(); _log(JSON.stringify(config)); } @@ -571,7 +573,7 @@ function checkForMove(curFrameBefore, app) { function windowGrabBegin(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) { _log('windowGrabBegin') - if (meta_window.resizeable) { + if (meta_window.resizeable && config.preview.enabled) { windowMoving = true; var app = global.display.focus_window; if (app.wintile) { @@ -585,7 +587,7 @@ function windowGrabBegin(meta_display, meta_screen, meta_window, meta_grab_op, g function windowGrabEnd(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) { _log('windowGrabEnd') - if (meta_window.resizeable) { + if (meta_window.resizeable && config.preview.enabled) { windowMoving = false; if (preview.visible == true) { var app = global.display.focus_window; diff --git a/prefs.js b/prefs.js index 43448ee..5c2a218 100644 --- a/prefs.js +++ b/prefs.js @@ -91,6 +91,21 @@ function buildPrefsWidget() { layout.attach(maximizeLabel, 0, 2, 1, 1); layout.attach(maximizeInput, 1, 2, 1, 1); + // Preview setting + let previewLabel = new Gtk.Label({ + label: _("Turn on mouse dragging support"), + visible: true, + hexpand: true, + halign: Gtk.Align.START + }); + let previewInput = new Gtk.Switch({ + active: this.settings.get_boolean ('preview'), + halign: Gtk.Align.END, + visible: true + }); + layout.attach(previewLabel, 0, 3, 1, 1); + layout.attach(previewInput, 1, 3, 1, 1); + // Debug setting let debugLabel = new Gtk.Label({ label: _("Turn on debugging"), @@ -103,11 +118,12 @@ function buildPrefsWidget() { halign: Gtk.Align.END, visible: true }); - layout.attach(debugLabel, 0, 3, 1, 1); - layout.attach(debugInput, 1, 3, 1, 1); + layout.attach(debugLabel, 0, 4, 1, 1); + layout.attach(debugInput, 1, 4, 1, 1); this.settings.bind('cols', colsInput, 'active', Gio.SettingsBindFlags.DEFAULT); this.settings.bind('use-maximize', maximizeInput, 'active', Gio.SettingsBindFlags.DEFAULT); + this.settings.bind('preview', previewInput, 'active', Gio.SettingsBindFlags.DEFAULT); this.settings.bind('debug', debugInput, 'active', Gio.SettingsBindFlags.DEFAULT); // Return our widget which will be added to the window diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 8b33492..3c6a08b 100644 Binary files a/schemas/gschemas.compiled and b/schemas/gschemas.compiled differ diff --git a/schemas/org.gnome.shell.extensions.wintile.gschema.xml b/schemas/org.gnome.shell.extensions.wintile.gschema.xml index 7a4b587..8663584 100644 --- a/schemas/org.gnome.shell.extensions.wintile.gschema.xml +++ b/schemas/org.gnome.shell.extensions.wintile.gschema.xml @@ -12,6 +12,11 @@ Turn on/off use of maximizing windows When on, certain windows that won't resize full screen like Terminal will, however animations may occur between tile shifts. + + true + Turn on/off mouse positioning + When on, dragging windows with the mouse will allow placement into the grid. + false Turn on/off debug output