aboutsummaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorokan2015-06-26 17:17:46 +0000
committerokan2015-06-26 17:17:46 +0000
commit0a8714c24e91e851245d33469341663bf594ab95 (patch)
tree98a43650f7748eefff2eee204a5a1188576bcaff /menu.c
parent8ee45f99bd44dcf347cc84ebb8afdddda5b28997 (diff)
downloadcwm-0a8714c24e91e851245d33469341663bf594ab95.tar.gz
Mechanical change from xinerama to region backed areas.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/menu.c b/menu.c
index cdfc5f4..a21bb7d 100644
--- a/menu.c
+++ b/menu.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: menu.c,v 1.83 2015/06/08 15:08:44 okan Exp $
+ * $OpenBSD: menu.c,v 1.84 2015/06/26 17:17:46 okan Exp $
*/
#include <sys/types.h>
@@ -331,7 +331,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
{
struct screen_ctx *sc = mc->sc;
struct menu *mi;
- struct geom xine;
+ struct geom area;
int n, xsave, ysave;
if (mc->list) {
@@ -374,25 +374,25 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
mc->num++;
}
- xine = screen_find_xinerama(sc, mc->geom.x, mc->geom.y, CWM_GAP);
- xine.w += xine.x - Conf.bwidth * 2;
- xine.h += xine.y - Conf.bwidth * 2;
+ area = screen_area(sc, mc->geom.x, mc->geom.y, CWM_GAP);
+ area.w += area.x - Conf.bwidth * 2;
+ area.h += area.y - Conf.bwidth * 2;
xsave = mc->geom.x;
ysave = mc->geom.y;
/* Never hide the top, or left side, of the menu. */
- if (mc->geom.x + mc->geom.w >= xine.w)
- mc->geom.x = xine.w - mc->geom.w;
- if (mc->geom.x < xine.x) {
- mc->geom.x = xine.x;
- mc->geom.w = MIN(mc->geom.w, (xine.w - xine.x));
+ if (mc->geom.x + mc->geom.w >= area.w)
+ mc->geom.x = area.w - mc->geom.w;
+ if (mc->geom.x < area.x) {
+ mc->geom.x = area.x;
+ mc->geom.w = MIN(mc->geom.w, (area.w - area.x));
}
- if (mc->geom.y + mc->geom.h >= xine.h)
- mc->geom.y = xine.h - mc->geom.h;
- if (mc->geom.y < xine.y) {
- mc->geom.y = xine.y;
- mc->geom.h = MIN(mc->geom.h, (xine.h - xine.y));
+ if (mc->geom.y + mc->geom.h >= area.h)
+ mc->geom.y = area.h - mc->geom.h;
+ if (mc->geom.y < area.y) {
+ mc->geom.y = area.y;
+ mc->geom.h = MIN(mc->geom.h, (area.h - area.y));
}
if (mc->geom.x != xsave || mc->geom.y != ysave)
@@ -415,7 +415,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
int y = n * (sc->xftfont->height + 1) + sc->xftfont->ascent + 1;
/* Stop drawing when menu doesn't fit inside the screen. */
- if (mc->geom.y + y > xine.h)
+ if (mc->geom.y + y > area.h)
break;
xu_xft_draw(sc, text, CWM_COLOR_MENU_FONT, 0, y);