fix(ags overview): make special workspace with plus sign create new workspace every time
This commit is contained in:
parent
113bd1ae88
commit
cb7507eedb
2 changed files with 12 additions and 12 deletions
|
@ -25,20 +25,24 @@ function createSurfaceFromWidget(widget) {
|
||||||
return surface;
|
return surface;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WorkspaceDrop = ({id, name, ...params} = {}) => EventBox({
|
let hidden = 0;
|
||||||
|
export const WorkspaceDrop = params => EventBox({
|
||||||
...params,
|
...params,
|
||||||
//tooltipText: `Workspace: ${id}`,
|
//tooltipText: `Workspace: ${id}`,
|
||||||
setup: eventbox => {
|
connections: [['drag-data-received', (eventbox, _w, _c, _x, data) => {
|
||||||
if (id < 0)
|
let id = eventbox.get_parent()._id;
|
||||||
id = name;
|
if (id < -1)
|
||||||
|
id = eventbox.get_parent()._name;
|
||||||
|
else if (id === -1)
|
||||||
|
id = `special:${++hidden}`;
|
||||||
else if (id === 1000)
|
else if (id === 1000)
|
||||||
id = "empty";
|
id = "empty";
|
||||||
|
|
||||||
|
execAsync(`hyprctl dispatch movetoworkspacesilent ${id},address:${data.get_text()}`)
|
||||||
|
.catch(print);
|
||||||
|
}]],
|
||||||
|
setup: eventbox => {
|
||||||
eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY);
|
eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY);
|
||||||
eventbox.connect('drag-data-received', (_w, _c, _x, _y, data) => {
|
|
||||||
execAsync(`hyprctl dispatch movetoworkspacesilent ${id},address:${data.get_text()}`)
|
|
||||||
.catch(print);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,6 @@ export const WorkspaceRow = (className, i) => Revealer({
|
||||||
['name', className === 'special' ? 'special' : ''],
|
['name', className === 'special' ? 'special' : ''],
|
||||||
],
|
],
|
||||||
child: WorkspaceDrop({
|
child: WorkspaceDrop({
|
||||||
id: className === 'special' ? -1 : 1000,
|
|
||||||
name: className === 'special' ? 'special' : '',
|
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'workspace',
|
className: 'workspace',
|
||||||
style: `min-width: ${VARS.SCREEN.X * VARS.SCALE}px;
|
style: `min-width: ${VARS.SCREEN.X * VARS.SCALE}px;
|
||||||
|
@ -78,8 +76,6 @@ const Workspace = (id, name) => Revealer({
|
||||||
box.revealChild = Hyprland.getWorkspace(box._id)?.windows > 0 || active;
|
box.revealChild = Hyprland.getWorkspace(box._id)?.windows > 0 || active;
|
||||||
}]],
|
}]],
|
||||||
child: WorkspaceDrop({
|
child: WorkspaceDrop({
|
||||||
id: id,
|
|
||||||
name: name,
|
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'workspace',
|
className: 'workspace',
|
||||||
style: `min-width: ${VARS.SCREEN.X * VARS.SCALE}px;
|
style: `min-width: ${VARS.SCREEN.X * VARS.SCALE}px;
|
||||||
|
|
Loading…
Reference in a new issue