Index: head/x11-wm/openbox/Makefile =================================================================== --- head/x11-wm/openbox/Makefile (revision 459580) +++ head/x11-wm/openbox/Makefile (revision 459581) @@ -1,53 +1,60 @@ # Created by: trevor # $FreeBSD$ PORTNAME= openbox PORTVERSION= 3.6 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11-wm MASTER_SITES= http://openbox.org/dist/openbox/ MAINTAINER= novel@FreeBSD.org COMMENT= Small, fast, standards compliant, extensible window manager LICENSE= GPLv2 LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 GNU_CONFIGURE= yes USES= gmake libtool pathfix python:run pkgconfig shebangfix USE_GNOME= cairo glib20 libxml2 USE_XORG= ice sm x11 xcursor xext xft xinerama xrandr \ xrender xau USE_LDCONFIG= yes +INSTALL_TARGET= install-strip SHEBANG_FILES= data/autostart/openbox-xdg-autostart CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib -lXext PLIST_SUB= VERSION=${PORTVERSION} -OPTIONS_DEFINE= NLS IMLIB PANGO SVG NOTIFY +OPTIONS_DEFINE= NLS IMLIB PANGO SVG NOTIFY PATCHES OPTIONS_DEFAULT= IMLIB PANGO NOTIFY SVG OPTIONS_SUB= yes NLS_USES= gettext NLS_CONFIGURE_OFF= --disable-nls PANGO_USE= GNOME=pango PANG_CONFIGURE_OFF= --disable-pango NOTIFY_LIB_DEPENDS= libstartup-notification-1.so:x11/startup-notification NOTIFY_CONFIGURE_OFF= --disable-startup-notification IMLIB_CONFIGURE_ENABLE= imlib2 IMLIB_LIB_DEPENDS= libImlib2.so:graphics/imlib2 SVG_USE= GNOME=librsvg2 SVG_CONFIGURE_ENABLE= librsvg + +PATCHES_DESC= Enable 3rd party patches (such as rounded corners) +PATCHES_EXTRA_PATCHES= ${PATCHDIR}/openbox-3.5.0-title-matching.patch:-p1 \ + ${PATCHDIR}/openbox-3.5.0-which-2.20.patch:-p1 \ + ${PATCHDIR}/openbox-3.6.2-fix-out-of-bounds.patch:-p1 \ + ${PATCHDIR}/openbox-3.6.2-rounded-corners.patch:-p1 post-configure: @${CHMOD} +x ${WRKSRC}/install-sh .include Index: head/x11-wm/openbox/distinfo =================================================================== --- head/x11-wm/openbox/distinfo (revision 459580) +++ head/x11-wm/openbox/distinfo (revision 459581) @@ -1,2 +1,3 @@ +TIMESTAMP = 1516419364 SHA256 (openbox-3.6.tar.gz) = 866c0ab8cb1cd15c7ae8022179cb6132a4c0f0476673bd3b834a1ef67a593ba8 SIZE (openbox-3.6.tar.gz) = 963207 Index: head/x11-wm/openbox/files/openbox-3.5.0-title-matching.patch =================================================================== --- head/x11-wm/openbox/files/openbox-3.5.0-title-matching.patch (nonexistent) +++ head/x11-wm/openbox/files/openbox-3.5.0-title-matching.patch (revision 459581) @@ -0,0 +1,11 @@ +--- openbox-3.5.0/openbox/client.c 2011-08-01 22:14:58.000000000 +0200 ++++ openbox-3.5.0/openbox/client.c 2011-10-22 14:59:56.000000000 +0200 +@@ -883,7 +883,7 @@ + !g_pattern_match(app->role, + strlen(self->role), self->role, NULL)) + match = FALSE; +- else if (app->title && ++ else if (app->title && self->title && + !g_pattern_match(app->title, + strlen(self->title), self->title, NULL)) + match = FALSE; Property changes on: head/x11-wm/openbox/files/openbox-3.5.0-title-matching.patch ___________________________________________________________________ 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/openbox/files/openbox-3.5.0-which-2.20.patch =================================================================== --- head/x11-wm/openbox/files/openbox-3.5.0-which-2.20.patch (nonexistent) +++ head/x11-wm/openbox/files/openbox-3.5.0-which-2.20.patch (revision 459581) @@ -0,0 +1,11 @@ +--- openbox-3.5.0/data/autostart/autostart.in~ 2011-08-02 15:50:01.963531310 +0000 ++++ openbox-3.5.0/data/autostart/autostart.in 2011-08-02 15:51:57.277879458 +0000 +@@ -8,7 +8,7 @@ + # + #if test -x @libexecdir@/gnome-settings-daemon >/dev/null; then + # @libexecdir@/gnome-settings-daemon & +-#elif which gnome-settings-daemon >/dev/null; then ++#elif which gnome-settings-daemon >/dev/null 2>&1; then + # gnome-settings-daemon & + #fi + Property changes on: head/x11-wm/openbox/files/openbox-3.5.0-which-2.20.patch ___________________________________________________________________ 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/openbox/files/openbox-3.6.2-fix-out-of-bounds.patch =================================================================== --- head/x11-wm/openbox/files/openbox-3.6.2-fix-out-of-bounds.patch (nonexistent) +++ head/x11-wm/openbox/files/openbox-3.6.2-fix-out-of-bounds.patch (revision 459581) @@ -0,0 +1,22 @@ +From b0ed75ee851121ad25491ef6e1dca25be7bc50f3 Mon Sep 17 00:00:00 2001 +From: o9000 +Date: Wed, 5 Apr 2017 12:38:10 +0200 +Subject: [PATCH] Fix out-of-bounds read + +--- + openbox/frame.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/openbox/frame.c b/openbox/frame.c +index 89669726a..943b6380b 100644 +--- a/openbox/frame.c ++++ b/openbox/frame.c +@@ -1215,7 +1215,7 @@ static void layout_title(ObFrame *self) + } + + /* stop at the end of the string (or the label, which calls break) */ +- for (; *lc != '\0' && lc >= config_title_layout; lc+=i) { ++ for (; lc >= config_title_layout && *lc != '\0'; lc+=i) { + if (*lc == 'L') { + if (i > 0) { + self->label_on = TRUE; Property changes on: head/x11-wm/openbox/files/openbox-3.6.2-fix-out-of-bounds.patch ___________________________________________________________________ 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/openbox/files/openbox-3.6.2-rounded-corners.patch =================================================================== --- head/x11-wm/openbox/files/openbox-3.6.2-rounded-corners.patch (nonexistent) +++ head/x11-wm/openbox/files/openbox-3.6.2-rounded-corners.patch (revision 459581) @@ -0,0 +1,178 @@ +diff --git a/openbox/config.c b/openbox/config.c +index dad5d1bf..a387335c 100644 +--- a/openbox/config.c ++++ b/openbox/config.c +@@ -48,6 +48,8 @@ StrutPartial config_margins; + gchar *config_theme; + gboolean config_theme_keepborder; + guint config_theme_window_list_icon_size; ++guint config_theme_cornerradius; ++gboolean config_theme_menuradius; + + gchar *config_title_layout; + +@@ -719,6 +721,10 @@ static void parse_theme(xmlNodePtr node, gpointer d) + else if (config_theme_window_list_icon_size > 96) + config_theme_window_list_icon_size = 96; + } ++ if ((n = obt_xml_find_node(node, "cornerRadius"))) { ++ config_theme_cornerradius = obt_xml_node_int(n); ++ obt_xml_attr_bool(n, "menu", &config_theme_menuradius); ++ } + + for (n = obt_xml_find_node(node, "font"); + n; +@@ -1098,6 +1104,8 @@ void config_startup(ObtXmlInst *i) + config_title_layout = g_strdup("NLIMC"); + config_theme_keepborder = TRUE; + config_theme_window_list_icon_size = 36; ++ config_theme_cornerradius = 0; ++ config_theme_menuradius = TRUE; + + config_font_activewindow = NULL; + config_font_inactivewindow = NULL; +diff --git a/openbox/config.h b/openbox/config.h +index 96a66cf1..5622d059 100644 +--- a/openbox/config.h ++++ b/openbox/config.h +@@ -152,6 +152,10 @@ extern gchar *config_title_layout; + extern gboolean config_animate_iconify; + /*! Size of icons in focus switching dialogs */ + extern guint config_theme_window_list_icon_size; ++/*! Display rounded corners for decorated windows */ ++extern guint config_theme_cornerradius; ++/*! Display rounded corners for root and client-list menus */ ++extern gboolean config_theme_menuradius; + + /*! The font for the active window's title */ + extern RrFont *config_font_activewindow; +diff --git a/openbox/frame.c b/openbox/frame.c +index 89669726..1539717c 100644 +--- a/openbox/frame.c ++++ b/openbox/frame.c +@@ -334,6 +334,51 @@ void frame_adjust_shape(ObFrame *self) + #endif + } + ++void frame_round_corners(Window window) ++{ ++ XWindowAttributes win_attr; ++ XGetWindowAttributes(obt_display, window, &win_attr); ++ ++ // If this returns null, the window is invalid. ++ if(!XGetWindowAttributes(obt_display, window, &win_attr)) ++ return; ++ ++ int width = win_attr.width + win_attr.border_width; ++ int height = win_attr.height + win_attr.border_width; ++ int rad = config_theme_cornerradius; ++ int dia = 2 * rad; ++ ++ // do not try to round if the window would be smaller than the corners ++ if(width < dia || height < dia) ++ return; ++ ++ Pixmap mask = XCreatePixmap(obt_display, window, width, height, 1); ++ // if this returns null, the mask is not drawable ++ if(!mask) ++ return; ++ ++ XGCValues xgcv; ++ GC shape_gc = XCreateGC(obt_display, mask, 0, &xgcv); ++ if(!shape_gc) { ++ XFreePixmap(obt_display, mask); ++ return; ++ } ++ ++ XSetForeground(obt_display, shape_gc, 0); ++ XFillRectangle(obt_display, mask, shape_gc, 0, 0, width, height); ++ XSetForeground(obt_display, shape_gc, 1); ++ XFillArc(obt_display, mask, shape_gc, 0, 0, dia, dia, 0, 23040); ++ XFillArc(obt_display, mask, shape_gc, width-dia-1, 0, dia, dia, 0, 23040); ++ XFillArc(obt_display, mask, shape_gc, 0, height-dia-1, dia, dia, 0, 23040); ++ XFillArc(obt_display, mask, shape_gc, width-dia-1, height-dia-1, dia, dia, ++ 0, 23040); ++ XFillRectangle(obt_display, mask, shape_gc, rad, 0, width-dia, height); ++ XFillRectangle(obt_display, mask, shape_gc, 0, rad, width, height-dia); ++ XShapeCombineMask(obt_display, window, ShapeBounding, 0, 0, mask, ShapeSet); ++ XFreePixmap(obt_display, mask); ++ XFreeGC(obt_display, shape_gc); ++} ++ + void frame_adjust_area(ObFrame *self, gboolean moved, + gboolean resized, gboolean fake) + { +@@ -857,7 +902,6 @@ void frame_adjust_area(ObFrame *self, gboolean moved, + + if (resized) { + self->need_render = TRUE; +- framerender_frame(self); + frame_adjust_shape(self); + } + +@@ -884,7 +928,9 @@ void frame_adjust_area(ObFrame *self, gboolean moved, + { + XResizeWindow(obt_display, self->label, self->label_width, + ob_rr_theme->label_height); ++ self->need_render = TRUE; + } ++ framerender_frame(self); + } + + static void frame_adjust_cursors(ObFrame *self) +@@ -958,6 +1004,8 @@ void frame_adjust_client_area(ObFrame *self) + XMoveResizeWindow(obt_display, self->backfront, 0, 0, + self->client->area.width, + self->client->area.height); ++ self->need_render = TRUE; ++ framerender_frame(self); + } + + void frame_adjust_state(ObFrame *self) +diff --git a/openbox/framerender.c b/openbox/framerender.c +index 094d5962..54046580 100644 +--- a/openbox/framerender.c ++++ b/openbox/framerender.c +@@ -21,6 +21,7 @@ + #include "openbox.h" + #include "screen.h" + #include "client.h" ++#include "config.h" + #include "framerender.h" + #include "obrender/theme.h" + +@@ -42,6 +43,12 @@ void framerender_frame(ObFrame *self) + return; + self->need_render = FALSE; + ++ if (config_theme_cornerradius && ++ !self->client->fullscreen && ++ !self->client->shaped && ++ !(self->client->type == OB_CLIENT_TYPE_DOCK)) ++ frame_round_corners(self->window); ++ + { + gulong px; + +diff --git a/openbox/menuframe.c b/openbox/menuframe.c +index c37fdcc5..f598cf15 100644 +--- a/openbox/menuframe.c ++++ b/openbox/menuframe.c +@@ -17,6 +17,7 @@ + See the COPYING file for a copy of the GNU General Public License. + */ + ++#include "frame.h" + #include "menuframe.h" + #include "client.h" + #include "menu.h" +@@ -845,6 +846,9 @@ void menu_frame_render(ObMenuFrame *self) + + RECT_SET_SIZE(self->area, w, h); + ++ if (config_theme_menuradius) ++ frame_round_corners(self->window); ++ + XFlush(obt_display); + } + Property changes on: head/x11-wm/openbox/files/openbox-3.6.2-rounded-corners.patch ___________________________________________________________________ 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/openbox/pkg-descr =================================================================== --- head/x11-wm/openbox/pkg-descr (revision 459580) +++ head/x11-wm/openbox/pkg-descr (revision 459581) @@ -1,22 +1,26 @@ Openbox is a highly configurable, next generation window manager with extensive standards support. Openbox lets you bring the latest applications outside of a full desktop environment. Most modern applications have been written with GNOME and KDE in mind. With support for the latest freedesktop.org standards, as well as careful adherence to previous standards, Openbox provides an environment where applications work the way they were designed to. Openbox is a highly configurable window manager. It allows you to change almost every aspect of how you interact with your desktop and invent completely new ways to use and control it. It can be like a video game for controlling windows. But Openbox can also be kept extremely simple, as it is in the default setup, meaning that it can suit just about anybody. Openbox gives you control without making you do everything. Openbox makes desktop environments better. By running Openbox inside the GNOME or K desktop environments, you can combine their ease and functionality with the power of Openbox. Your desktop becomes cleaner and faster, and is in your control, when you use Openbox. +This port also includes optional 3rd party patches for rounder corners +support and miscellaneous fixes from +https://github.com/dylanaraps/openbox-patched. + WWW: http://openbox.org/