Fix icon finding in awful.util
(upstream git commit b4b6e6c1fcc94814bed6587ba3e43be6baace3a5) xwindow_shape_pixmap: Correctly handle invalid geometry (upstream git commit c9ff826fbef2b9d4df84c1ef5ec5eba33661abee)
This commit is contained in:
parent
2cd85067db
commit
458afdc8fe
@ -1,8 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.76 2014/04/15 11:16:04 dcoppa Exp $
|
||||
# $OpenBSD: Makefile,v 1.77 2014/04/15 14:56:45 dcoppa Exp $
|
||||
|
||||
COMMENT= highly configurable framework window manager
|
||||
|
||||
DISTNAME= awesome-3.5.5
|
||||
REVISION= 0
|
||||
EXTRACT_SUFX= .tar.xz
|
||||
CATEGORIES= x11
|
||||
|
||||
|
@ -1,7 +1,16 @@
|
||||
$OpenBSD: patch-lib_awful_util_lua_in,v 1.7 2014/04/15 11:16:04 dcoppa Exp $
|
||||
$OpenBSD: patch-lib_awful_util_lua_in,v 1.8 2014/04/15 14:56:45 dcoppa Exp $
|
||||
|
||||
commit b4b6e6c1fcc94814bed6587ba3e43be6baace3a5
|
||||
Author: Gino! <grey@greygrease.nowhere.lan>
|
||||
Date: Fri Apr 11 17:09:10 2014 -0400
|
||||
|
||||
Fix Icon Finding in awful.util
|
||||
|
||||
This should also fix naughty failures to display the correct icons
|
||||
|
||||
--- lib/awful/util.lua.in.orig Fri Apr 11 11:07:10 2014
|
||||
+++ lib/awful/util.lua.in Tue Apr 15 12:54:46 2014
|
||||
@@ -180,12 +180,12 @@ end
|
||||
+++ lib/awful/util.lua.in Tue Apr 15 16:28:51 2014
|
||||
@@ -180,25 +180,28 @@ end
|
||||
-- It searches for the icon path under the directories given w/the right ext
|
||||
-- @param iconname The name of the icon to search for.
|
||||
-- @param exts Table of image extensions allowed, otherwise { 'png', gif' }
|
||||
@ -12,7 +21,31 @@ $OpenBSD: patch-lib_awful_util_lua_in,v 1.7 2014/04/15 11:16:04 dcoppa Exp $
|
||||
function util.geticonpath(iconname, exts, dirs, size)
|
||||
exts = exts or { 'png', 'gif' }
|
||||
- dirs = dirs or { '/usr/share/pixmaps/' }
|
||||
+ dirs = dirs or { '${LOCALBASE}/share/pixmaps/' }
|
||||
+ dirs = dirs or { '${LOCALBASE}/share/pixmaps/', '${LOCALBASE}/share/icons/hicolor/' }
|
||||
+ icontypes = { 'apps', 'actions', 'categories', 'emblems',
|
||||
+ 'mimetypes', 'status', 'devices', 'extras', 'places', 'stock' }
|
||||
for _, d in pairs(dirs) do
|
||||
+ local icon
|
||||
for _, e in pairs(exts) do
|
||||
local icon
|
||||
- local icon
|
||||
- if size then
|
||||
- icon = string.format("%s%ux%u/%s.%s",
|
||||
- d, size, size, iconname, e)
|
||||
- if util.file_readable(icon) then
|
||||
- return icon
|
||||
- end
|
||||
- end
|
||||
icon = d .. iconname .. '.' .. e
|
||||
if util.file_readable(icon) then
|
||||
return icon
|
||||
+ end
|
||||
+ if size then
|
||||
+ for _, t in pairs(icontypes) do
|
||||
+ icon = string.format("%s%ux%u/%s/%s.%s", d, size, size, t, iconname, e)
|
||||
+ if util.file_readable(icon) then
|
||||
+ return icon
|
||||
+ end
|
||||
+ end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
22
x11/awesome/patches/patch-xwindow_c
Normal file
22
x11/awesome/patches/patch-xwindow_c
Normal file
@ -0,0 +1,22 @@
|
||||
$OpenBSD: patch-xwindow_c,v 1.6 2014/04/15 14:56:45 dcoppa Exp $
|
||||
|
||||
commit c9ff826fbef2b9d4df84c1ef5ec5eba33661abee
|
||||
Author: Uli Schlachter <psychon@znc.in>
|
||||
Date: Mon Apr 14 10:04:14 2014 +0200
|
||||
|
||||
xwindow_shape_pixmap: Correctly handle invalid geometry
|
||||
|
||||
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
||||
|
||||
--- xwindow.c.orig Tue Apr 15 16:30:41 2014
|
||||
+++ xwindow.c Tue Apr 15 16:32:02 2014
|
||||
@@ -330,6 +330,9 @@ xwindow_shape_pixmap(int width, int height, cairo_surf
|
||||
cairo_surface_t *dest;
|
||||
cairo_t *cr;
|
||||
|
||||
+ if (width <= 0 || height <= 0)
|
||||
+ return XCB_NONE;
|
||||
+
|
||||
xcb_create_pixmap(globalconf.connection, 1, pixmap, globalconf.screen->root, width, height);
|
||||
dest = cairo_xcb_surface_create_for_bitmap(globalconf.connection, globalconf.screen, pixmap, width, height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user