[wiki] [sites] preview-all-windows:format diff and set window border width || HJ-Zhang

From: <git_AT_suckless.org>
Date: Fri, 26 Jul 2024 08:14:21 +0200

commit 28ccc57aba38d071c5c7e8c68ccb1b0245da8321
Author: HJ-Zhang <hjzhang216_AT_gmail.com>
Date: Fri Jul 26 14:14:17 2024 +0800

    preview-all-windows:format diff and set window border width

diff --git a/dwm.suckless.org/patches/preview-all-win/dwm-preview-all-windows-6.5.diff b/dwm.suckless.org/patches/preview-all-win/dwm-preview-all-windows-6.5.diff
index a3ef0934..93e5d251 100644
--- a/dwm.suckless.org/patches/preview-all-win/dwm-preview-all-windows-6.5.diff
+++ b/dwm.suckless.org/patches/preview-all-win/dwm-preview-all-windows-6.5.diff
_AT_@ -1,12 +1,12 @@
 diff --git a/config.def.h b/config.def.h
-index 9efa774..2992668 100644
+index 9efa774..f462e32 100644
 --- a/config.def.h
 +++ b/config.def.h
 _AT_@ -95,6 +95,7 @@ static const Key keys[] = {
          TAGKEYS( XK_8, 7)
          TAGKEYS( XK_9, 8)
          { MODKEY|ShiftMask, XK_q, quit, {0} },
-+ { MODKEY, XK_r, previewallwin, {0} },
++ { MODKEY, XK_r, previewallwin, {0} },
  };
  
  /* button definitions */
_AT_@ -24,7 +24,7 @@ index 8efca9a..8d7c303 100644
  # flags
  CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 diff --git a/dwm.c b/dwm.c
-index 67c6b2b..bf30141 100644
+index 67c6b2b..0ddd58e 100644
 --- a/dwm.c
 +++ b/dwm.c
 _AT_@ -40,6 +40,8 @@
_AT_@ -72,11 +72,12 @@ index 67c6b2b..bf30141 100644
  
  /* variables */
  static const char broken[] = "broken";
-_AT_@ -2140,6 +2157,205 @@ zoom(const Arg *arg)
+_AT_@ -2140,6 +2157,212 @@ zoom(const Arg *arg)
          pop(c);
  }
  
-+void previewallwin(){
++void
++previewallwin(){
 + int composite_event_base, composite_error_base;
 + if (!XCompositeQueryExtension(dpy, &composite_event_base, &composite_error_base)) {
 + fprintf(stderr, "Error: XComposite extension not available.
");
_AT_@ -104,6 +105,7 @@ index 67c6b2b..bf30141 100644
 + else
 + XMoveResizeWindow(dpy, c->pre.win, c->pre.x, c->pre.y, c->pre.scaled_image->width, c->pre.scaled_image->height);
 + XSetWindowBorder(dpy, c->pre.win, scheme[SchemeNorm][ColBorder].pixel);
++ XSetWindowBorderWidth(dpy, c->pre.win, borderpx);
 + XUnmapWindow(dpy, c->win);
 + if (c->pre.win){
 + XSelectInput(dpy, c->pre.win, ButtonPress | EnterWindowMask | LeaveWindowMask );
_AT_@ -158,7 +160,8 @@ index 67c6b2b..bf30141 100644
 + focus(focus_c);
 +}
 +
-+void setpreviewwindowsizepositions(unsigned int n, Monitor *m, unsigned int gappo, unsigned int gappi){
++void
++setpreviewwindowsizepositions(unsigned int n, Monitor *m, unsigned int gappo, unsigned int gappi){
 + unsigned int i, j;
 + unsigned int cx, cy, cw, ch, cmaxh;
 + unsigned int cols, rows;
_AT_@ -222,7 +225,8 @@ index 67c6b2b..bf30141 100644
 + c->pre.y += cy;
 +}
 +
-+XImage *getwindowximage(Client *c) {
++XImage
++*getwindowximage(Client *c) {
 + XCompositeRedirectWindow(dpy, c->win, CompositeRedirectAutomatic);
 + XWindowAttributes attr;
 + XGetWindowAttributes( dpy, c->win, &attr );
_AT_@ -253,7 +257,8 @@ index 67c6b2b..bf30141 100644
 + return temp;
 +}
 +
-+XImage *scaledownimage(XImage *orig_image, unsigned int cw, unsigned int ch) {
++XImage
++*scaledownimage(XImage *orig_image, unsigned int cw, unsigned int ch) {
 + int factor_w = orig_image->width / cw + 1;
 + int factor_h = orig_image->height / ch + 1;
 + int scale_factor = factor_w > factor_h ? factor_w : factor_h;
Received on Fri Jul 26 2024 - 08:14:21 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 26 2024 - 08:24:51 CEST