1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-03-26 14:43:33 +01:00

Compare commits

...

4 Commits

Author SHA1 Message Date
b5ddbf5fa7 Align version string in info panel for wmaker 2023-03-21 21:03:24 +01:00
4a3debae68 Update scale icons patch 2023-03-21 19:52:31 +01:00
9f99479411 Update patch for terminals max 2023-03-21 19:49:36 +01:00
f93c8ecf33 Added scale icon patch.
Added patch[1] by Robert Lillack, to gain ability to nicely fit icons in
miniwindows.

[1] https://github.com/roblillack/wmaker/pull/5
2023-03-21 19:21:49 +01:00
4 changed files with 152 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
AUX wmaker-ignore-max-for-terminals.patch 1309 BLAKE2B 605136e83cbfa3acb05fcb7e2b0d82bd05007997e970d4ffe9bf302254193aa5806ba696a4fa226158194b7d0e69b0ba2e7eda6009c07d4015add016d878d4c5 SHA512 63a3ab78b688638562c3eb040e8df02254633d594a380b21777163fe8fa1a140d0f1ea6e419c53aa58c1624a3098d5a1873ebca57bda3b32954407acff1cd13f
AUX wmaker-ignore-max-for-terminals.patch 1383 BLAKE2B 201512604d37dc92158b05f0dc1aa881538e1793c0d21f992053791068ae9600d281c2db392ad51a40815edee2a6dea9f8baec0031ca6a01e52941d40cefb9fe SHA512 d95c9f224ec2cb3c449f017823355293cc3dfe602189678b2b0307c8b4232ea4e7ae7572d51ecd9e6eb6801615da6fce11fe92622cea5c4d084a104d41d12988
AUX wmaker-scale-icons.patch 4936 BLAKE2B cbb71e2820871a51f3d1521934538b02b0067963d784c5bff07e8ee2236e878b5351609d684f599464a180dc1b6f22ae324bb31121bcadd04006ebfd24908d85 SHA512 1bae42785cd177b28ca1d58cafb5cb4cc13216b8116eb0bf2a716ddb1f795d5c8de9a1aea378699505e211e6dfa57602d5e82de9557d9a0822e27d91712746f2
AUX wmaker.desktop 206 BLAKE2B 62fe60afde032c1f37c5c818bc37a97d70605e041e539e922f18d56a7582fffd1689762f600fa3c69c5b62dd399867c8c1208d393060e734b38a84540143bf79 SHA512 d1dc99aa29047434e1265c8f93ce366b7c026f27eec8a166904fda1ab4144e0d6142807ac09ba6cbcb86480257893e5553046a0ba1a8e1d6315f23dd8468482b
DIST WindowMaker-extra-0.1.tar.gz 238018 BLAKE2B 865b12975d0cdefc1f05a76344b449fdcf8a2841d6a7adf1ab6435857d89cbc4fda22bb62432a1bbba921267380d00a0cded718bfbd344bbb5e6207e59b76096 SHA512 0fe9b3ffc093942db167d8a01e15c0f6741f3a40959d1434ea4f23e7b9d4a9c13935a61eabef9691e5fdfd4e407564caafce15c2d65d66499960a6764a874ab8
EBUILD windowmaker-8888.ebuild 3426 BLAKE2B 11995ec89ea63a5d2d49b4ce79ef56a245a81f18e08813c54a7bb97d6205d15324607d0beb70dca7434bce75104a85e6916dcedb11e4026c1c4cd221cb3acc71 SHA512 57d62fd5e79c076214a658138d132c8a99f4e702746b238ad8ed976fcc8f85c8372b41c023ae51e0950f4027a0efa3420a3407b46c6c84d33f69f39923ea6498
EBUILD windowmaker-8888.ebuild 3642 BLAKE2B e81eafd6ae6751de32c5c859675e1060dd047235a31ef2424c271d6b4e51c32276b67b5080c2fa835291c241fe818b7c4935079970a1058bad0124063a9c7c33 SHA512 9980c143cf6cc9bd065288cee54623a2bf910756780bfd997ac8ffa8c3ea82828924470f560678bc1594575e4fce64593b48637d3f14b0e52a19de4ee17dbbfe

View File

@@ -1,9 +1,9 @@
diff --git a/src/window.c b/src/window.c
index 70e1f962..2acc4e3c 100644
index 1f16f458..a9bad2f6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1911,10 +1911,9 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
}
@@ -1902,10 +1902,8 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
int baseH = 0;
if (wwin->normal_hints) {
- if (!wwin->flags.maximized) {
@@ -12,11 +12,10 @@ index 70e1f962..2acc4e3c 100644
- }
+ winc = wwin->normal_hints->width_inc;
+ hinc = wwin->normal_hints->height_inc;
+
minW = wwin->normal_hints->min_width;
minH = wwin->normal_hints->min_height;
maxW = wwin->normal_hints->max_width;
@@ -1981,17 +1980,15 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
if (wwin->normal_hints->min_width > minW)
minW = wwin->normal_hints->min_width;
if (wwin->normal_hints->min_height > minH)
@@ -1980,17 +1978,15 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
}
}
@@ -33,11 +32,12 @@ index 70e1f962..2acc4e3c 100644
- if (baseH != 0)
- height = (((height - baseH) / hinc) * hinc) + baseH;
- else
- height = (((height - minH) / hinc) * hinc) + minH;
- }
+ if (baseH != 0)
+ height = (((height - baseH) / hinc) * hinc) + baseH;
+ else
height = (((height - minH) / hinc) * hinc) + minH;
- }
+ height = (((height - minH) / hinc) * hinc) + minH;
/* broken stupid apps may cause preposterous values for these.. */
if (width > 0)

View File

@@ -0,0 +1,135 @@
diff --git a/src/defaults.c b/src/defaults.c
index f5cbf46f..77401c6d 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -366,7 +366,7 @@ WDefaultEntry optionList[] = {
&wPreferences.icon_yard, getEnum, setIconPosition, NULL, NULL},
{"IconificationStyle", "Zoom", seIconificationStyles,
&wPreferences.iconification_style, getEnum, NULL, NULL, NULL},
- {"EnforceIconMargin", "NO", NULL,
+ {"EnforceIconMargin", "YES", NULL,
&wPreferences.enforce_icon_margin, getBool, NULL, NULL, NULL},
{"DisableWSMouseActions", "NO", NULL,
&wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL},
diff --git a/src/icon.c b/src/icon.c
index 943e2d84..079fdee7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -336,22 +336,39 @@ void wIconChangeTitle(WIcon *icon, WWindow *wwin)
icon->icon_name = wNETWMGetWindowName(wwin->client_win);
}
-RImage *wIconValidateIconSize(RImage *icon, int max_size)
+RImage *wIconValidateIconSize(RImage *icon, int max_size, Bool scale_down)
{
RImage *nimage;
if (!icon)
return NULL;
- /* We should hold "ICON_BORDER" (~2) pixels to include the icon border */
- if (((max_size + ICON_BORDER) < icon->width) ||
- ((max_size + ICON_BORDER) < icon->height)) {
+ int wanted = max_size;
+
+ if (scale_down) {
+ /* For some image sources, we want to ensure that the icon is fitting */
+
+ if (wPreferences.enforce_icon_margin) {
+ /* better use only 75% of icon_size. For 64x64 this means 48x48
+ * This leaves room around the icon for the miniwindow title and
+ * results in better overall aesthetics -Dan */
+ wanted = (int)((double)wPreferences.icon_size * 0.75 + 0.5);
+
+ /* the size should be a multiple of 4 */
+ wanted = (wanted >> 2) << 2;
+ } else {
+
+ /* This is the "old" approach, which just adds a 3px border */
+ wanted = (max_size - ICON_BORDER);
+ }
+ }
+
+ if (icon->width > wanted || icon->height > wanted) {
if (icon->width > icon->height)
- nimage = RScaleImage(icon, max_size - ICON_BORDER,
- (icon->height * (max_size - ICON_BORDER) / icon->width));
+ nimage = RScaleImage(icon, wanted, icon->height * wanted / icon->width);
else
- nimage = RScaleImage(icon, (icon->width * (max_size - ICON_BORDER) / icon->height),
- max_size - ICON_BORDER);
+ nimage = RScaleImage(icon, icon->width * wanted / icon->height, wanted);
+
RReleaseImage(icon);
icon = nimage;
}
@@ -791,7 +808,7 @@ RImage *get_rimage_icon_from_wm_hints(WIcon *icon)
return NULL;
/* Resize the icon to the wPreferences.icon_size size */
- image = wIconValidateIconSize(image, wPreferences.icon_size);
+ image = wIconValidateIconSize(image, wPreferences.icon_size, True);
return image;
}
diff --git a/src/icon.h b/src/icon.h
index cccd7a86..49054a5d 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -70,7 +70,7 @@ void update_icon_pixmap(WIcon *icon);
int wIconChangeImageFile(WIcon *icon, const char *file);
-RImage *wIconValidateIconSize(RImage *icon, int max_size);
+RImage *wIconValidateIconSize(RImage *icon, int max_size, Bool scale_down);
RImage *get_rimage_icon_from_wm_hints(WIcon *icon);
char *wIconStore(WIcon *icon);
diff --git a/src/switchpanel.c b/src/switchpanel.c
index cb6cda10..16f91be0 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -199,7 +199,7 @@ static void addIconForWindow(WSwitchPanel *panel, WMWidget *parent, WWindow *wwi
image = get_icon_image(panel->scr, wwin->wm_instance, wwin->wm_class, icon_tile_size);
/* We must resize the icon size (~64) to the switch panel icon size (~48) */
- image = wIconValidateIconSize(image, icon_size);
+ image = wIconValidateIconSize(image, icon_size, False);
WMAddToArray(panel->images, image);
WMAddToArray(panel->icons, icon);
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 7aad3db5..0bb476b9 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -435,7 +435,7 @@ RImage *get_rimage_from_file(WScreen *scr, const char *file_name, int max_size)
wwarning(_("error loading image file \"%s\": %s"), file_name,
RMessageForError(RErrorCode));
- image = wIconValidateIconSize(image, max_size);
+ image = wIconValidateIconSize(image, max_size, False);
return image;
}
@@ -472,7 +472,7 @@ RImage *get_default_image(WScreen *scr)
/* Resize the icon to the wPreferences.icon_size size
* usually this function will return early, because size is right */
- image = wIconValidateIconSize(image, wPreferences.icon_size);
+ image = wIconValidateIconSize(image, wPreferences.icon_size, False);
return image;
}
diff --git a/src/wmspec.c b/src/wmspec.c
index e61e6ae7..dff085ac 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -545,7 +545,7 @@ RImage *get_window_image_from_x11(Window window)
return NULL;
/* Resize the image to the correct value */
- image = wIconValidateIconSize(image, wPreferences.icon_size);
+ image = wIconValidateIconSize(image, wPreferences.icon_size, False);
return image;
}

View File

@@ -44,12 +44,15 @@ src_unpack() {
git-r3_src_unpack
}
PATCHES=( )
PATCHES=( "${FILESDIR}/wmaker-scale-icons.patch" )
src_prepare() {
# Add info about commit in About window
local git_revision=$(git log --pretty=format:'%h' -n 1)
sed -i -e "s/\(AC_INIT(\[WindowMaker\],\[[^]]*\)\]/\1, rev.${git_revision}\]/" configure.ac || die
# Align version string to the right (I have very small fonts set in
# config)
sed -i -e "s/panel->versionL, WMScaleX(30)/panel->versionL, WMScaleX(88)/" src/dialog.c || die
# Fix some paths
for file in WindowMaker/*menu* util/wmgenmenu.c; do