Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Created November 1, 2022 06:05
Show Gist options
  • Save lidgnulinux/ecdef60f5a4ccd9f988c57ab2749ac8b to your computer and use it in GitHub Desktop.
Save lidgnulinux/ecdef60f5a4ccd9f988c57ab2749ac8b to your computer and use it in GitHub Desktop.
--- config.def.h.orig 2022-11-01 12:59:11.582373763 +0700
+++ config.def.h 2022-11-01 12:47:54.465483948 +0700
@@ -12,11 +12,12 @@
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating monitor x y width height */
/* examples:
{ "Gimp", NULL, 0, 1, -1 },
*/
- { "firefox", NULL, 1 << 8, 0, -1 },
+ { "Gimp", NULL, 0, 1, -1, 0, 0, 500, 400 },
+ { "firefox", NULL, 1 << 8, 0, -1, 200, 100, 0, 0 },
};
/* layout(s) */
--- dwl.c.orig 2022-11-01 12:59:39.474914527 +0700
+++ dwl.c 2022-11-01 12:44:32.202681608 +0700
@@ -200,6 +200,10 @@
unsigned int tags;
int isfloating;
int monitor;
+ int x;
+ int y;
+ int w;
+ int h;
} Rule;
/* function declarations */
@@ -488,6 +492,12 @@
wl_list_for_each(m, &mons, link)
if (r->monitor == i++)
mon = m;
+ if (c->isfloating)
+ resize(c, (struct wlr_box){
+ r->x ? r->x + mon->w.x : mon->w.width / 2 - c->geom.width / 2 + mon->w.x,
+ r->y ? r->y + mon->w.y : mon->w.height / 2 - c->geom.height / 2 + mon->w.y,
+ r->w ? r->w : c->geom.width,
+ r->h ? r->h : c->geom.height}, 1);
}
}
wlr_scene_node_reparent(c->scene, layers[c->isfloating ? LyrFloat : LyrTile]);
@@ -1185,9 +1195,8 @@
c->isurgent = 0;
client_restack_surface(c);
- /* Don't change border color if there is an exclusive focus or we are
- * handling a drag operation */
- if (!exclusive_focus && !seat->drag)
+ /* Don't change border color if there is an exclusive focus */
+ if (!exclusive_focus)
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(c->border[i], focuscolor);
}
@@ -2262,9 +2271,6 @@
startdrag(struct wl_listener *listener, void *data)
{
struct wlr_drag *drag = data;
- /* During drag the focus isn't sent to clients, this causes that
- * we don't update border color acording the pointer coordinates */
- focusclient(NULL, 0);
if (!drag->icon)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment