forked from Shinonome/dots-hyprland
overview: fix workspace focus on click
This commit is contained in:
@@ -18,6 +18,7 @@ import { substitute } from "../.miscutils/icons.js";
|
|||||||
|
|
||||||
const NUM_OF_WORKSPACES_SHOWN = userOptions.overview.numOfCols * userOptions.overview.numOfRows;
|
const NUM_OF_WORKSPACES_SHOWN = userOptions.overview.numOfCols * userOptions.overview.numOfRows;
|
||||||
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
||||||
|
const POPUP_CLOSE_TIME = 100; // ms
|
||||||
|
|
||||||
const overviewTick = Variable(false);
|
const overviewTick = Variable(false);
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ export default () => {
|
|||||||
`,
|
`,
|
||||||
onClicked: (self) => {
|
onClicked: (self) => {
|
||||||
App.closeWindow('overview');
|
App.closeWindow('overview');
|
||||||
Utils.timeout(100, () => Hyprland.messageAsync(`dispatch focuswindow address:${address}`));
|
Utils.timeout(POPUP_CLOSE_TIME, () => Hyprland.messageAsync(`dispatch focuswindow address:${address}`));
|
||||||
},
|
},
|
||||||
onMiddleClickRelease: () => Hyprland.messageAsync(`dispatch closewindow address:${address}`),
|
onMiddleClickRelease: () => Hyprland.messageAsync(`dispatch closewindow address:${address}`),
|
||||||
onSecondaryClick: (button) => {
|
onSecondaryClick: (button) => {
|
||||||
@@ -226,8 +227,8 @@ export default () => {
|
|||||||
hexpand: true,
|
hexpand: true,
|
||||||
vexpand: true,
|
vexpand: true,
|
||||||
onPrimaryClick: () => {
|
onPrimaryClick: () => {
|
||||||
Hyprland.messageAsync(`dispatch workspace ${index}`)
|
|
||||||
App.closeWindow('overview');
|
App.closeWindow('overview');
|
||||||
|
Utils.timeout(POPUP_CLOSE_TIME, () => Hyprland.messageAsync(`dispatch workspace ${index}`));
|
||||||
},
|
},
|
||||||
setup: (eventbox) => {
|
setup: (eventbox) => {
|
||||||
eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY);
|
eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY);
|
||||||
|
|||||||
Reference in New Issue
Block a user