Sync with '3.5' maintenance branch:

drawin: Don't special-case moves
(upstream git commit 6673ecb167c5a5d85c8bacab15c1b6c0c7f65e80)

drawin_update_drawing: Remove optimization for invisible drawins
(upstream git commit f236a5f0c70015c0c2b3a57a8aec9dcc5dc49bdc)

wibox.layout.base.rect_to_device_geometry: Fix for "weird" rotations
(upstream git commit 983d094c76c5ddb6fe7deeec2f977a981c057a8a)
This commit is contained in:
dcoppa 2014-10-13 09:00:48 +00:00
parent c6d0a272f0
commit c359cf6136
3 changed files with 133 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.85 2014/09/29 11:12:54 dcoppa Exp $
# $OpenBSD: Makefile,v 1.86 2014/10/13 09:00:48 dcoppa Exp $
COMMENT= highly configurable framework window manager
DISTNAME= awesome-3.5.5
REVISION= 7
REVISION= 8
EXTRACT_SUFX= .tar.xz
CATEGORIES= x11
@ -73,6 +73,7 @@ post-install:
${WRKINST}${LOCALBASE}/share/awesome/lib/awful/widget/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/menubar/*.{beforesubst,orig} \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/layout/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/widget/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/themes/default/*.{beforesubst,orig}
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/awesome

View File

@ -0,0 +1,46 @@
$OpenBSD: patch-lib_wibox_layout_base_lua_in,v 1.1 2014/10/13 09:00:48 dcoppa Exp $
commit 983d094c76c5ddb6fe7deeec2f977a981c057a8a
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Oct 5 10:47:39 2014 +0200
wibox.layout.base.rect_to_device_geometry: Fix for "weird" rotations
The old code transformed the top-left and bottom-right corner of
the rectangle to device space and calculated a rectangle based on
these two points. However, if you rotate a rectangle by 45 degrees,
these two points will be directly above each other and thus the old
code would calculate a width of 0.
Fix this by transforming all four corners of the rectangle into
device space and calculating a rectangle based on this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- lib/wibox/layout/base.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/wibox/layout/base.lua.in Tue Oct 7 13:37:21 2014
@@ -13,15 +13,17 @@ local max = math.max
-- wibox.layout.base
local base = {}
---- Figure out the geometry in device coordinate space. This will break if
--- someone rotates the coordinate space by a non-multiple of 90°.
+--- Figure out the geometry in device coordinate space. This gives only tight
+-- bounds if no rotations by non-multiples of 90 degrees are used.
function base.rect_to_device_geometry(cr, x, y, width, height)
local x1, y1 = cr:user_to_device(x, y)
- local x2, y2 = cr:user_to_device(x + width, y + height)
- local x = min(x1, x2)
- local y = min(y1, y2)
- local width = max(x1, x2) - x
- local height = max(y1, y2) - y
+ local x2, y2 = cr:user_to_device(x, y + height)
+ local x3, y3 = cr:user_to_device(x + width, y + height)
+ local x4, y4 = cr:user_to_device(x + width, y)
+ local x = min(x1, x2, x3, x4)
+ local y = min(y1, y2, y3, y4)
+ local width = max(x1, x2, x3, x4) - x
+ local height = max(y1, y2, y3, y4) - y
return x, y, width, height
end

View File

@ -0,0 +1,84 @@
$OpenBSD: patch-objects_drawin_c,v 1.5 2014/10/13 09:00:48 dcoppa Exp $
commit f236a5f0c70015c0c2b3a57a8aec9dcc5dc49bdc
Author: Uli Schlachter <psychon@znc.in>
Date: Sat Oct 11 13:27:29 2014 +0200
drawin_update_drawing: Remove optimization for invisible drawins
This fixes the following code:
local d = drawin({})
d.visible = true
The drawin now has a cairo surface assigned
d.visible = false
d.width = 1234
d.visible = true
The width change while the drawin was not visible would not get propagated to
the drawable because of the code that this patch removes. The expectation was
that drawin_map() would update the drawable later.
However, because the drawin was already visible, its drawable also already has
a surface assigned. Thus, drawin_map() wouldn't update the drawable either.
Fix this by just removing this optimizations.
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit 6673ecb167c5a5d85c8bacab15c1b6c0c7f65e80
Author: Uli Schlachter <psychon@znc.in>
Date: Sat Oct 11 13:12:57 2014 +0200
drawin: Don't special-case moves
The code in drawin_moveresize() tries to be clever and only updates the drawing
state of the drawable when it is resized, not when it is moved around. This used
to be necessary because once upon a time, drawin_update_drawing() threw away all
of the drawing state and thus forcing a repaint. These days it just calls
drawable_set_geometry() as well and that function special-cases moves.
So this old code in drawin_moveresize() is no longer necessary and actually
caused problems.
These problems occurred because drawin_update_drawing() is being clever and
doesn't do anything for .visible = false drawins, because their drawing state
will be updated once they become visible. However, not skipping
drawable_set_geometry() means that this broke, because drawin_map() thought that
the drawing state was up to date while in reality it wasn't.
References: http://article.gmane.org/gmane.comp.window-managers.awesome/10852
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- objects/drawin.c.orig Fri Apr 11 11:07:10 2014
+++ objects/drawin.c Mon Oct 13 10:39:02 2014
@@ -82,11 +82,6 @@ drawin_unref_simplified(drawin_t **item)
static void
drawin_update_drawing(drawin_t *w, int widx)
{
- /* If this drawin isn't visible, we don't need an up-to-date cairo surface
- * for it. (drawin_map() will later make sure we are called again) */
- if(!w->visible)
- return;
-
luaA_object_push_item(globalconf.L, widx, w->drawable);
drawable_set_geometry(w->drawable, -1, w->geometry);
lua_pop(globalconf.L, 1);
@@ -137,14 +132,7 @@ drawin_moveresize(lua_State *L, int udx, area_t geomet
mask_vals |= XCB_CONFIG_WINDOW_HEIGHT;
}
- if(mask_vals & (XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT))
- drawin_update_drawing(w, udx);
- else {
- /* We still have to set x/y */
- luaA_object_push_item(L, udx, w->drawable);
- drawable_set_geometry(w->drawable, -1, w->geometry);
- lua_pop(L, 1);
- }
+ drawin_update_drawing(w, udx);
/* Activate BMA */
client_ignore_enterleave_events();