Index: head/x11-wm/blackbox/Makefile =================================================================== --- head/x11-wm/blackbox/Makefile (revision 476721) +++ head/x11-wm/blackbox/Makefile (revision 476722) @@ -1,53 +1,54 @@ # Created by: Brian Handy # $FreeBSD$ PORTNAME= blackbox PORTVERSION= 0.70.1 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= x11-wm MASTER_SITES= SF/${PORTNAME}wm/${PORTNAME}wm/Blackbox%20${PORTVERSION} MAINTAINER= A.J.Caines@halplant.com COMMENT= Small and fast window manager for X11R6 LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE -GNU_CONFIGURE= yes USES= pathfix pkgconfig iconv USE_XORG= x11 xft + +GNU_CONFIGURE= yes LDFLAGS+= ${ICONV_LIB} PORTDOCS= README.bbtools README.bsetbg +MANPAGES= bsetbg.1 bsetroot.1 -OPTIONS_DEFINE= TOOLS_ONLY +OPTIONS_DEFINE= TOOLS_ONLY + TOOLS_ONLY_DESC= Do not install window manager, only tools +TOOLS_ONLY_INSTALL_TARGET= -C util install # XXX dirty hack :( +TOOLS_ONLY_MAKE_ARGS= SUBDIRS="doc lib util" bin_PROGRAMS=bsetroot +TOOLS_ONLY_VARS= PKGNAMESUFFIX=-tools \ + COMMENT+="(tools only)" +TOOLS_ONLY_VARS_OFF= PORTDOCS+="AUTHORS COMPLIANCE ChangeLog README RELNOTES TODO" + .include .if ${ARCH} == armv6 || ${ARCH} == armv7 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_Toolbar.cc .endif -.if ${PORT_OPTIONS:MTOOLS_ONLY} -PKGNAMESUFFIX= -tools -COMMENT+= (tools only) -MAKE_ARGS= SUBDIRS="doc lib util" bin_PROGRAMS=bsetroot -INSTALL_TARGET= -C util install # XXX dirty hack :( -.else -PORTDOCS+= AUTHORS COMPLIANCE ChangeLog README RELNOTES TODO -.endif - post-patch: # Fix the build with libX11 > 1.40 @${REINPLACE_CMD} -e 's/_XUTIL_H_/_X11&/' ${WRKSRC}/lib/Util.hh post-install: -.if ${PORT_OPTIONS:MTOOLS_ONLY} - @${REINPLACE_CMD} -E '/[^s]\/blackbox|bstyleconvert|lib|include/d' \ - ${TMPPLIST} - ${INSTALL_MAN} ${MAN1:S#^#${WRKSRC}/doc/#} ${STAGEDIR}${MANPREFIX}/man/man1 -.endif @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S#^#${WRKSRC}/#} ${STAGEDIR}${DOCSDIR} + +post-install-TOOLS_ONLY-on: + @${REINPLACE_CMD} -E '/[^s]\/blackbox|bstyleconvert|lib|include/d' \ + ${TMPPLIST} + ${INSTALL_MAN} ${MANPAGES:S#^#${WRKSRC}/doc/#} ${STAGEDIR}${MANPREFIX}/man/man1 .include Index: head/x11-wm/blackbox/files/patch-lib_Display.cc =================================================================== --- head/x11-wm/blackbox/files/patch-lib_Display.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-lib_Display.cc (revision 476722) @@ -1,36 +1,36 @@ ---- lib/Display.cc.orig 2005-01-03 10:42:38.000000000 +0100 -+++ lib/Display.cc 2013-08-31 15:42:48.395906537 +0200 +--- lib/Display.cc.orig 2005-01-03 09:42:38 UTC ++++ lib/Display.cc @@ -25,6 +25,7 @@ #include "Display.hh" #include +#include #include @@ -32,7 +33,6 @@ #include #include - namespace bt { void createBitmapLoader(const Display &display); -@@ -68,7 +68,7 @@ +@@ -68,7 +68,7 @@ bt::Display::Display(const char *dpy_name, bool multi_ if (!(xdisplay = XOpenDisplay(dpy_name))) { fprintf(stderr, "bt::Display: failed to open display '%s'\n", dpy_name ? dpy_name : ""); - ::exit(2); + std::exit(2); } #ifdef DEBUG -@@ -77,7 +77,7 @@ +@@ -77,7 +77,7 @@ bt::Display::Display(const char *dpy_name, bool multi_ if (fcntl(XConnectionNumber(xdisplay), F_SETFD, 1) == -1) { fprintf(stderr, "bt::Display: failed to mark connection close-on-exec\n"); - ::exit(2); + std::exit(2); } if (!multi_head || ScreenCount(xdisplay) == 1) { Index: head/x11-wm/blackbox/files/patch-lib_EWMH.cc =================================================================== --- head/x11-wm/blackbox/files/patch-lib_EWMH.cc (nonexistent) +++ head/x11-wm/blackbox/files/patch-lib_EWMH.cc (revision 476722) @@ -0,0 +1,15 @@ +# Fix error: non-constant-expression cannot be narrowed from type 'long' to +# 'unsigned long' in initializer list [-Wc++11-narrowing] +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226708 + +--- lib/EWMH.cc.orig 2018-08-09 04:45:57 UTC ++++ lib/EWMH.cc +@@ -247,7 +247,7 @@ bool bt::EWMH::readDesktopGeometry(Window target, + + void bt::EWMH::setDesktopViewport(Window target, int x, int y) const { + const unsigned long viewport[] = +- { static_cast(x), static_cast(y) }; ++ { static_cast(x), static_cast(y) }; + setProperty(target, XA_CARDINAL, net_desktop_viewport, + reinterpret_cast(viewport), 2); + } Property changes on: head/x11-wm/blackbox/files/patch-lib_EWMH.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/x11-wm/blackbox/files/patch-lib_Menu.cc =================================================================== --- head/x11-wm/blackbox/files/patch-lib_Menu.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-lib_Menu.cc (revision 476722) @@ -1,71 +1,71 @@ ---- lib/Menu.cc.orig 2013-08-31 15:45:50.982895002 +0200 -+++ lib/Menu.cc 2013-08-31 15:53:36.911861215 +0200 +--- lib/Menu.cc.orig 2005-01-27 17:08:22 UTC ++++ lib/Menu.cc @@ -30,6 +30,8 @@ #include "PixmapCache.hh" #include "Resource.hh" +#include + #include #include -@@ -135,11 +137,11 @@ +@@ -135,11 +137,11 @@ void bt::MenuStyle::load(const Resource &resource) { str = resource.read("menu.title.marginWidth", "Menu.Title.MarginWidth", "1"); title_margin = - static_cast(std::max(strtol(str.c_str(), 0, 0), 0l)); + static_cast(std::max(std::strtol(str.c_str(), 0, 0), 0l)); str = resource.read("menu.frame.marginWidth", "Menu.Frame.MarginWidth", "1"); frame_margin = - static_cast(std::max(strtol(str.c_str(), 0, 0), 0l)); + static_cast(std::max(std::strtol(str.c_str(), 0, 0), 0l)); } -@@ -363,7 +365,7 @@ +@@ -363,7 +365,7 @@ unsigned int bt::Menu::insertItem(const MenuItem &item } else { index = std::min(static_cast(index), _items.size()); it = _items.begin(); - std::advance(it, index); + std::advance(it, index); } it = _items.insert(it, item); -@@ -514,7 +516,7 @@ +@@ -514,7 +516,7 @@ void bt::Menu::removeItem(unsigned int id) { void bt::Menu::removeIndex(unsigned int index) { ItemList::iterator it = _items.begin(); - std::advance(it, index); + std::advance(it, index); if (it == _items.end()) return; // item not found removeItemByIterator(it); -@@ -1035,7 +1037,7 @@ +@@ -1035,7 +1037,7 @@ void bt::Menu::keyPressEvent(const XKeyEvent * const e const ItemList::const_iterator &end = _items.end(); ItemList::const_iterator anchor = _items.begin(); if (_active_index != ~0u) { - std::advance(anchor, _active_index); + std::advance(anchor, _active_index); // go one paste the current active index if (anchor != end && !anchor->separator) -@@ -1055,8 +1057,7 @@ +@@ -1055,8 +1057,7 @@ void bt::Menu::keyPressEvent(const XKeyEvent * const e ItemList::const_reverse_iterator anchor = _items.rbegin(); const ItemList::const_reverse_iterator &end = _items.rend(); if (_active_index != ~0u) { - std::advance - (anchor, _items.size() - _active_index - 1); + std::advance(anchor, _items.size() - _active_index - 1); // go one item past the current active index if (anchor != end && !anchor->separator) -@@ -1174,7 +1175,7 @@ +@@ -1174,7 +1175,7 @@ unsigned int bt::Menu::verifyId(unsigned int id) { } fprintf(stderr, "Error: bt::Menu::verifyId: id %u already used\n", id); - abort(); + std::abort(); } std::vector::iterator it = Index: head/x11-wm/blackbox/files/patch-lib_Texture.cc =================================================================== --- head/x11-wm/blackbox/files/patch-lib_Texture.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-lib_Texture.cc (revision 476722) @@ -1,19 +1,19 @@ ---- lib/Texture.cc.orig 2013-08-31 15:55:19.995853042 +0200 -+++ lib/Texture.cc 2013-08-31 15:55:47.288909835 +0200 +--- lib/Texture.cc.orig 2005-03-15 07:01:36 UTC ++++ lib/Texture.cc @@ -28,6 +28,7 @@ #include "Resource.hh" #include +#include #include #include -@@ -184,7 +185,7 @@ +@@ -184,7 +185,7 @@ bt::Texture bt::textureResource(const Display &display const std::string bstr = resource.read(name + ".borderWidth", className + ".BorderWidth", "1"); - unsigned int bw = static_cast(strtoul(bstr.c_str(), 0, 0)); + unsigned int bw = static_cast(std::strtoul(bstr.c_str(), 0, 0)); texture.setBorderWidth(bw); } Index: head/x11-wm/blackbox/files/patch-src_Screen.cc =================================================================== --- head/x11-wm/blackbox/files/patch-src_Screen.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-src_Screen.cc (revision 476722) @@ -1,19 +1,19 @@ ---- src/Screen.cc.orig 2008-11-17 11:30:06.000000000 -0800 -+++ src/Screen.cc 2008-11-17 11:31:37.000000000 -0800 -@@ -1870,11 +1870,12 @@ +--- src/Screen.cc.orig 2005-10-18 08:07:22 UTC ++++ src/Screen.cc +@@ -1870,11 +1870,12 @@ void BScreen::clientMessageEvent(const XClientMessageE if (event->message_type == _blackbox->ewmh().numberOfDesktops()) { unsigned int number = event->data.l[0]; - if (number > workspaceCount()) { - for (; number != workspaceCount(); --number) + unsigned int wsCount = workspaceCount(); + if (number > wsCount) { + for (; number != wsCount; --number) addWorkspace(); - } else if (number < workspaceCount()) { - for (; number != workspaceCount(); ++number) + } else if (number < wsCount) { + for (; number != wsCount; ++number) removeLastWorkspace(); } } else if (event->message_type == _blackbox->ewmh().desktopNames()) { Index: head/x11-wm/blackbox/files/patch-src_Slit.cc =================================================================== --- head/x11-wm/blackbox/files/patch-src_Slit.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-src_Slit.cc (revision 476722) @@ -1,16 +1,16 @@ ---- src/Slit.cc.orig 2005-01-04 20:58:33.000000000 +0800 -+++ src/Slit.cc 2011-06-21 13:31:00.000000000 +0800 -@@ -248,6 +248,13 @@ +--- src/Slit.cc.orig 2005-01-04 12:58:33 UTC ++++ src/Slit.cc +@@ -248,6 +248,13 @@ void Slit::reconfigure(void) { bt::PixmapCache::find(screen->screenNumber(), texture, frame.rect.width(), frame.rect.height(), frame.pixmap); + + if ((texture.texture() & bt::Texture::Gradient) && frame.pixmap) + XSetWindowBackgroundPixmap(display, frame.window, frame.pixmap); + else if ((texture.texture() & bt::Texture::Solid)) + XSetWindowBackground(display, frame.window, + texture.color1().pixel(screen->screenNumber())); + XClearArea(display, frame.window, 0, 0, frame.rect.width(), frame.rect.height(), True); Index: head/x11-wm/blackbox/files/patch-src_Window.cc =================================================================== --- head/x11-wm/blackbox/files/patch-src_Window.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-src_Window.cc (revision 476722) @@ -1,74 +1,74 @@ ---- src/Window.cc.orig 2013-08-31 15:58:41.720845042 +0200 -+++ src/Window.cc 2013-08-31 16:00:13.671837757 +0200 +--- src/Window.cc.orig 2005-10-18 08:01:41 UTC ++++ src/Window.cc @@ -33,6 +33,8 @@ #include "Workspace.hh" #include "blackbox.hh" +#include + #include #include #include -@@ -3699,14 +3701,14 @@ +@@ -3699,14 +3701,14 @@ void collisionAdjust(int *dx, int *dy, int x, int y, wtop = y, wbottom = y + height - 1, // left, right, top + bottom are for rect, douterleft = left border of rect - dinnerleft = abs(wleft - rect.left()), - dinnerright = abs(wright - rect.right()), - dinnertop = abs(wtop - rect.top()), - dinnerbottom = abs(wbottom - rect.bottom()), - douterleft = abs(wright - rect.left()), - douterright = abs(wleft - rect.right()), - doutertop = abs(wbottom - rect.top()), - douterbottom = abs(wtop - rect.bottom()); + dinnerleft = std::abs(wleft - rect.left()), + dinnerright = std::abs(wright - rect.right()), + dinnertop = std::abs(wtop - rect.top()), + dinnerbottom = std::abs(wbottom - rect.bottom()), + douterleft = std::abs(wright - rect.left()), + douterright = std::abs(wleft - rect.right()), + doutertop = std::abs(wbottom - rect.top()), + douterbottom = std::abs(wtop - rect.bottom()); if ((wtop <= rect.bottom() && wbottom >= rect.top()) || doutertop <= snap_distance -@@ -3749,8 +3751,8 @@ +@@ -3749,8 +3751,8 @@ void collisionAdjust(int *dx, int *dy, int x, int y, const int cwy = y + height / 2; const int crx = rect.x() + rect.width() / 2; const int cry = rect.y() + rect.height() / 2; - const int cdx = abs(cwx - crx); - const int cdy = abs(cwy - cry); + const int cdx = std::abs(cwx - crx); + const int cdy = std::abs(cwy - cry); if (cdx <= snap_distance) // snap to horizontal center *dx = x - (rect.x() + ((rect.width() - width) / 2)); -@@ -3773,13 +3775,13 @@ +@@ -3773,13 +3775,13 @@ void BlackboxWindow::snapAdjust(int *x, int *y) { if (edge_distance) { collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), frame.rect.height(), _screen->availableArea(), edge_distance, true); - nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; - ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; + nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; + ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; if (!blackbox->resource().fullMaximization()) { collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), frame.rect.height(), _screen->screenInfo().rect(), edge_distance); - nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; - ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; + nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; + ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; } } if (win_distance) { -@@ -3791,8 +3793,8 @@ +@@ -3791,8 +3793,8 @@ void BlackboxWindow::snapAdjust(int *x, int *y) { win->workspace() == _screen->currentWorkspace()) { collisionAdjust(&dx, &dy, *x, *y, frame.rect.width(), frame.rect.height(), win->frame.rect, win_distance); - nx = (dx != init_dx && abs(dx) < abs(nx)) ? dx : nx; dx = init_dx; - ny = (dy != init_dy && abs(dy) < abs(ny)) ? dy : ny; dy = init_dy; + nx = (dx != init_dx && std::abs(dx) < std::abs(nx)) ? dx : nx; dx = init_dx; + ny = (dy != init_dy && std::abs(dy) < std::abs(ny)) ? dy : ny; dy = init_dy; } } } Index: head/x11-wm/blackbox/files/patch-src_blackbox.cc =================================================================== --- head/x11-wm/blackbox/files/patch-src_blackbox.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-src_blackbox.cc (revision 476722) @@ -1,28 +1,28 @@ ---- src/blackbox.cc.orig 2013-08-31 16:03:04.354825567 +0200 -+++ src/blackbox.cc 2013-08-31 16:12:46.759944855 +0200 +--- src/blackbox.cc.orig 2005-10-18 11:33:25 UTC ++++ src/blackbox.cc @@ -27,6 +27,8 @@ #include "Slit.hh" #include "Window.hh" +#include + #include #include #include @@ -36,6 +38,7 @@ #include #include #include +#include #include // #define FOCUS_DEBUG -@@ -422,7 +425,7 @@ +@@ -422,7 +425,7 @@ Blackbox::Blackbox(char **m_argv, const char *dpy_name if (managed == 0) { fprintf(stderr, "%s: no managable screens found, exiting...\n", applicationName().c_str()); - ::exit(3); + std::exit(3); } screen_list_count = managed; Index: head/x11-wm/blackbox/files/patch-src_main.cc =================================================================== --- head/x11-wm/blackbox/files/patch-src_main.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-src_main.cc (revision 476722) @@ -1,45 +1,45 @@ ---- src/main.cc.orig 2013-08-31 16:15:04.709773262 +0200 -+++ src/main.cc 2013-08-31 16:15:45.604774045 +0200 +--- src/main.cc.orig 2005-01-03 09:42:57 UTC ++++ src/main.cc @@ -24,6 +24,8 @@ // #define PRINT_SIZES +#include + #if defined(PRINT_SIZES) # include "Screen.hh" # include "Slit.hh" -@@ -69,7 +71,7 @@ +@@ -69,7 +71,7 @@ static void showHelp(int exitval) { #endif // SHAPE ); - ::exit(exitval); + std::exit(exitval); } int main(int argc, char **argv) { -@@ -87,13 +89,13 @@ +@@ -87,13 +89,13 @@ int main(int argc, char **argv) { "Copyright (c) 1997 - 2000, 2002 - 2005 Bradley T Hughes\n", __blackbox_version); - ::exit(0); + std::exit(0); } else if (! strcmp(argv[i], "-rc")) { // look for alternative rc file to use if ((++i) >= argc) { fprintf(stderr, "error: '-rc' requires and argument\n"); - ::exit(1); + std::exit(1); } rc_file = argv[i]; -@@ -103,7 +105,7 @@ +@@ -103,7 +105,7 @@ int main(int argc, char **argv) { if ((++i) >= argc) { fprintf(stderr, "error: '-display' requires an argument\n"); - ::exit(1); + std::exit(1); } dpy_name = argv[i]; Index: head/x11-wm/blackbox/files/patch-util_bsetroot.cc =================================================================== --- head/x11-wm/blackbox/files/patch-util_bsetroot.cc (revision 476721) +++ head/x11-wm/blackbox/files/patch-util_bsetroot.cc (revision 476722) @@ -1,42 +1,42 @@ ---- util/bsetroot.cc.orig 2013-08-31 16:18:50.697762748 +0200 -+++ util/bsetroot.cc 2013-08-31 16:19:53.695753444 +0200 +--- util/bsetroot.cc.orig 2005-03-15 07:01:37 UTC ++++ util/bsetroot.cc @@ -28,6 +28,7 @@ #include #include +#include #include #include -@@ -68,11 +69,11 @@ +@@ -68,11 +69,11 @@ bsetroot::bsetroot(int argc, char **argv, char *dpy_na } else if (! strcmp("-mod", argv[i])) { if ((++i) >= argc) usage(); - mod_x = atoi(argv[i]); + mod_x = std::atoi(argv[i]); if ((++i) >= argc) usage(); - mod_y = atoi(argv[i]); + mod_y = std::atoi(argv[i]); if (mod_x < 1) mod_x = 1; if (mod_y < 1) mod_y = 1; -@@ -336,7 +337,7 @@ +@@ -336,7 +337,7 @@ void bsetroot::usage(int exit_code) { " -to gradient end color\n\n" " -solid solid color\n\n" " -help print this help text and exit\n"); - exit(exit_code); + std::exit(exit_code); } int main(int argc, char **argv) { -@@ -350,7 +351,7 @@ +@@ -350,7 +351,7 @@ int main(int argc, char **argv) { if ((++i) >= argc) { fprintf(stderr, "error: '-display' requires an argument\n"); - ::exit(1); + std::exit(1); } display_name = argv[i];