Added delay on mouse preview

This commit is contained in:
Fmstrat
2020-01-02 17:01:06 -05:00
parent 00a2785b14
commit c93cb70576

View File

@@ -26,8 +26,11 @@ var _log = function(str) {
let config = { let config = {
cols: 2, cols: 2,
useMaximize: true, useMaximize: true,
close: 75, debug: true,
debug: true preview: {
close: 75,
delay: 500
}
} }
// Get the GSchema for our settings // Get the GSchema for our settings
@@ -573,7 +576,9 @@ function windowGrabBegin(meta_display, meta_screen, meta_window, meta_grab_op, g
if (app.wintile) { if (app.wintile) {
checkForMove(app.get_frame_rect(), app); checkForMove(app.get_frame_rect(), app);
} }
checkIfNearGrid(app); Mainloop.timeout_add(500, function () {
checkIfNearGrid(app);
});
} }
function windowGrabEnd(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) { function windowGrabEnd(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) {
@@ -606,9 +611,9 @@ function resetBinding(settings, key) {
} }
function isClose(a, b) { function isClose(a, b) {
if (a <= b && a > b - config.close) if (a <= b && a > b - config.preview.close)
return true; return true;
else if (a >= b && a < b + config.close) else if (a >= b && a < b + config.preview.close)
return true; return true;
else else
return false; return false;
@@ -689,7 +694,7 @@ function checkIfNearGrid(app) {
} }
if (!close) if (!close)
hidePreview(); hidePreview();
Mainloop.timeout_add(100, function () { Mainloop.timeout_add(500, function () {
checkIfNearGrid(app); checkIfNearGrid(app);
}); });
} }