mirror of
https://github.com/FranP-code/wintile.git
synced 2025-10-13 00:33:46 +00:00
Added delay on mouse preview
This commit is contained in:
17
extension.js
17
extension.js
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user