Compare commits

..

No commits in common. "6a8275950ed781f5924f7986f3e6b3e2ee8c0214" and "66592a050721a97a917ad2985eb9f1a4da33c240" have entirely different histories.

2 changed files with 15 additions and 15 deletions

View File

@ -1,9 +1,9 @@
### Description
This patch is based on the
This patch is based in
[client-opacity](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/client-opacity/client-opacity.patch)
patch. This patch adds differing opacity levels depending upon whether the client is focused or not.
patch. Add different opacities level if the client is focus or not.
The opacity levels can be change by short cuts.
The opacities levels can be change by short cuts.
```
[MODKEY]+[Ctrl]+[k] -> increase focus opacity

View File

@ -16,7 +16,7 @@ index 95c2afa..b3170d1 100644
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
+static const float default_opacity_inactive = 0.70;
+static const float default_opacity = 0.70;
+static const float default_opacity_active = 1.00;
/* tagging - TAGCOUNT must be no greater than 31 */
@ -30,8 +30,8 @@ index 95c2afa..b3170d1 100644
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity_inactive, -1 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.00, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity, -1 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.0, -1 }, /* Start on ONLY tag "9" */
};
/* layout(s) */
@ -39,8 +39,8 @@ index 95c2afa..b3170d1 100644
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_k, setopacityinactive, {.f = +0.1f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_j, setopacityinactive, {.f = -0.1f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_k, setopacitydefault, {.f = +0.1f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_j, setopacitydefault, {.f = -0.1f} },
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_K, setopacityactive, {.f = +0.1f} },
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_J, setopacityactive, {.f = -0.1f} },
{ MODKEY, XKB_KEY_space, setlayout, {0} },
@ -56,7 +56,7 @@ index 12f441e..caafab1 100644
int isfloating, isurgent, isfullscreen;
+ float opacity;
+ float opacity_active;
+ float opacity_inactive;
+ float opacity_default;
uint32_t resize; /* configure serial of a pending resize */
} Client;
@ -80,7 +80,7 @@ index 12f441e..caafab1 100644
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
static void setmon(Client *c, Monitor *m, uint32_t newtags);
+static void setopacityinactive(const Arg *arg);
+static void setopacitydefault(const Arg *arg);
+static void setopacityactive(const Arg *arg);
static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
@ -98,9 +98,9 @@ index 12f441e..caafab1 100644
c->surface.xdg = toplevel->base;
c->bw = borderpx;
+ /* Set default opacity*/
+ c->opacity_inactive = default_opacity_inactive;
+ c->opacity_default = default_opacity;
+ c->opacity_active = default_opacity_active;
+ c->opacity = default_opacity_inactive;
+ c->opacity = default_opacity;
LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
@ -116,7 +116,7 @@ index 12f441e..caafab1 100644
client_set_border_color(old_c, bordercolor);
client_activate_surface(old, 0);
+ old_c->opacity = old_c->opacity_inactive;
+ old_c->opacity = old_c->opacity_default;
}
}
printstatus();
@ -158,7 +158,7 @@ index 12f441e..caafab1 100644
+
+void
+setopacityinactive(const Arg *arg)
+setopacitydefault(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ if (!sel)