"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hw/xwayland/xwayland-output.c" between
xorg-server-1.20.8.tar.bz2 and xorg-server-1.20.9.tar.bz2

About: The X.Org X Server component of the X Window System architecture.

xwayland-output.c  (xorg-server-1.20.8.tar.bz2):xwayland-output.c  (xorg-server-1.20.9.tar.bz2)
skipping to change at line 33 skipping to change at line 33
* SOFTWARE. * SOFTWARE.
*/ */
#ifdef HAVE_DIX_CONFIG_H #ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif #endif
#include "xwayland.h" #include "xwayland.h"
#include <randrstr.h> #include <randrstr.h>
#define DEFAULT_DPI 96
#define ALL_ROTATIONS (RR_Rotate_0 | \ #define ALL_ROTATIONS (RR_Rotate_0 | \
RR_Rotate_90 | \ RR_Rotate_90 | \
RR_Rotate_180 | \ RR_Rotate_180 | \
RR_Rotate_270 | \ RR_Rotate_270 | \
RR_Reflect_X | \ RR_Reflect_X | \
RR_Reflect_Y) RR_Reflect_Y)
static void xwl_output_get_xdg_output(struct xwl_output *xwl_output); static void xwl_output_get_xdg_output(struct xwl_output *xwl_output);
static Rotation static Rotation
skipping to change at line 146 skipping to change at line 145
output_height = xwl_output->width; output_height = xwl_output->width;
} }
if (*width < xwl_output->x + output_width) if (*width < xwl_output->x + output_width)
*width = xwl_output->x + output_width; *width = xwl_output->x + output_width;
if (*height < xwl_output->y + output_height) if (*height < xwl_output->y + output_height)
*height = xwl_output->y + output_height; *height = xwl_output->y + output_height;
} }
/* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs
* associated with it.
*
* It either calculates the mean mmpd of all the outputs or, if no reasonable
* value could be calculated, defaults to the mmpd of a screen with a DPI value
* of DEFAULT_DPI.
*/
static double
approximate_mmpd(struct xwl_screen *xwl_screen)
{
struct xwl_output *it;
int total_width_mm = 0;
int total_width = 0;
xorg_list_for_each_entry(it, &xwl_screen->output_list, link) {
if (it->randr_output->mmWidth == 0)
continue;
total_width_mm += it->randr_output->mmWidth;
total_width += it->width;
}
if (total_width_mm != 0)
return (double)total_width_mm / total_width;
else
return 25.4 / DEFAULT_DPI;
}
static int static int
xwl_set_pixmap_visit_window(WindowPtr window, void *data) xwl_set_pixmap_visit_window(WindowPtr window, void *data)
{ {
ScreenPtr screen = window->drawable.pScreen; ScreenPtr screen = window->drawable.pScreen;
if (screen->GetWindowPixmap(window) == data) { if (screen->GetWindowPixmap(window) == data) {
screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen));
return WT_WALKCHILDREN; return WT_WALKCHILDREN;
} }
skipping to change at line 212 skipping to change at line 183
pScreen->DestroyPixmap(old_pixmap); pScreen->DestroyPixmap(old_pixmap);
} }
pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL);
} }
static void static void
update_screen_size(struct xwl_output *xwl_output, int width, int height) update_screen_size(struct xwl_output *xwl_output, int width, int height)
{ {
struct xwl_screen *xwl_screen = xwl_output->xwl_screen; struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
double mmpd;
if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL)
SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE);
if (!xwl_screen->rootless && xwl_screen->screen->root) if (!xwl_screen->rootless && xwl_screen->screen->root)
update_backing_pixmaps (xwl_screen, width, height); update_backing_pixmaps (xwl_screen, width, height);
xwl_screen->width = width; xwl_screen->width = width;
xwl_screen->height = height; xwl_screen->height = height;
xwl_screen->screen->width = width; xwl_screen->screen->width = width;
xwl_screen->screen->height = height; xwl_screen->screen->height = height;
xwl_screen->screen->mmWidth = (width * 25.4) / monitorResolution;
if (xwl_output->width == width && xwl_output->height == height) { xwl_screen->screen->mmHeight = (height * 25.4) / monitorResolution;
xwl_screen->screen->mmWidth = xwl_output->randr_output->mmWidth;
xwl_screen->screen->mmHeight = xwl_output->randr_output->mmHeight;
} else {
mmpd = approximate_mmpd(xwl_screen);
xwl_screen->screen->mmWidth = width * mmpd;
xwl_screen->screen->mmHeight = height * mmpd;
}
SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode); SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode);
if (xwl_screen->screen->root) { if (xwl_screen->screen->root) {
BoxRec box = { 0, 0, width, height }; BoxRec box = { 0, 0, width, height };
xwl_screen->screen->root->drawable.width = width; xwl_screen->screen->root->drawable.width = width;
xwl_screen->screen->root->drawable.height = height; xwl_screen->screen->root->drawable.height = height;
RegionReset(&xwl_screen->screen->root->winSize, &box); RegionReset(&xwl_screen->screen->root->winSize, &box);
RRScreenSizeNotify(xwl_screen->screen); RRScreenSizeNotify(xwl_screen->screen);
 End of changes. 4 change blocks. 
39 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)