From 1fd33180c466bb5990223f3c1b5ff795bac12df1 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 1 Aug 2006 22:22:19 +0000 Subject: [PATCH] some -Txlib fixes --- lib/common/emit.c | 8 ++++---- plugin/xlib/gvdevice_xlib.c | 13 +++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index b26b03879..623398a7c 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -621,6 +621,10 @@ static void init_job_pagination(GVJ_t * job, graph_t *g) job->pagesArraySize.x = job->pagesArraySize.y = job->numPages = 1; } + /* initial window size */ + job->width = (imageSize.x + 2*margin.x) * job->dpi.x / POINTS_PER_INCH; + job->height = (imageSize.y + 2*margin.y) * job->dpi.x / POINTS_PER_INCH; + /* determine page box including centering */ if (GD_drawing(g)->centered) { if (pageSize.x > imageSize.x) @@ -1914,10 +1918,6 @@ static void setup_view(GVJ_t * job, graph_t * g) { double sx, sy; /* half width, half height in graph-units */ - /* compute width,height in device units */ - job->width = ROUND((job->view.x + 2 * job->margin.x) * job->dpi.x / POINTS_PER_INCH); - job->height = ROUND((job->view.y + 2 * job->margin.y) * job->dpi.y / POINTS_PER_INCH); - job->scale.x = job->zoom * job->dpi.x / POINTS_PER_INCH; job->scale.y = job->zoom * job->dpi.y / POINTS_PER_INCH; diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index b0e7538f1..a1e793754 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -274,7 +274,6 @@ static void update_display(GVJ_t *job, Display *dpy) static void init_window(GVJ_t *job, Display *dpy, int scr) { int argb = 0; - const char *geometry = NULL; const char *base = ""; XGCValues gcv; XSetWindowAttributes attributes; @@ -301,8 +300,10 @@ static void init_window(GVJ_t *job, Display *dpy, int scr) attributes.background_pixel = 0; attributes.border_pixel = 0; attributes.colormap = window->cmap; - attributemask = (CWBackPixel | - CWBorderPixel | CWOverrideRedirect | CWColormap); + attributemask = ( CWBackPixel + | CWBorderPixel + | CWOverrideRedirect + | CWColormap ); window->depth = 32; } else { window->cmap = DefaultColormap(dpy, scr); @@ -313,11 +314,6 @@ static void init_window(GVJ_t *job, Display *dpy, int scr) window->depth = DefaultDepth(dpy, scr); } - if (geometry) { - int x, y; - XParseGeometry(geometry, &x, &y, &job->width, &job->height); - } - window->win = XCreateWindow(dpy, RootWindow(dpy, scr), 0, 0, job->width, job->height, 0, window->depth, InputOutput, window->visual, @@ -499,6 +495,7 @@ static void finalize_xlib(GVJ_t *firstjob) dpy = (Display *)(firstjob->display); scr = firstjob->screen; + keycodes = firstjob->keycodes; inotify_fd = inotify_init(); if (inotify_fd < 0) { -- 2.40.0