From: Trent G. <tr...@us...> - 2012-11-30 03:19:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Allegro". The branch, 5.1 has been updated via 4f3ccc3fcc450eebc18680ba50a36d0b1f9a26df (commit) from 9e1decf5a0c1644b108302d4d0213e8c243ef99a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4f3ccc3fcc450eebc18680ba50a36d0b1f9a26df Author: Trent Gamblin <tr...@us...> Date: Thu Nov 29 20:18:32 2012 -0700 Fix mouse coordinate scaling on Pi. ----------------------------------------------------------------------- Summary of changes: src/raspberrypi/pidisplay.c | 2 +- src/x/xwindow.c | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/raspberrypi/pidisplay.c b/src/raspberrypi/pidisplay.c index 2a04635..b0e6172 100644 --- a/src/raspberrypi/pidisplay.c +++ b/src/raspberrypi/pidisplay.c @@ -472,7 +472,7 @@ static ALLEGRO_DISPLAY *raspberrypi_create_display(int w, int h) d->hide_cursor = false; - if (al_is_mouse_installed()) { + if (al_is_mouse_installed() && !getenv("DISPLAY")) { _al_evdev_set_mouse_range(0, 0, display->w-1, display->h-1); } diff --git a/src/x/xwindow.c b/src/x/xwindow.c index 92a6f28..a3bed53 100644 --- a/src/x/xwindow.c +++ b/src/x/xwindow.c @@ -19,14 +19,23 @@ void _al_xwin_set_size_hints(ALLEGRO_DISPLAY *d, int x_off, int y_off) ALLEGRO_SYSTEM_XGLX *system = (void *)al_get_system_driver(); ALLEGRO_DISPLAY_XGLX *glx = (void *)d; XSizeHints *hints = XAllocSizeHints(); + int w, h; hints->flags = 0; +#ifdef ALLEGRO_RASPBERRYPI + int x, y; + _al_raspberrypi_get_screen_info(&x, &y, &w, &h); +#else + w = d->w; + h = d->h; +#endif + /* Do not force the size of the window on resizeable or fullscreen windows */ /* on fullscreen windows, it confuses most X Window Managers */ if (!(d->flags & ALLEGRO_RESIZABLE) && !(d->flags & ALLEGRO_FULLSCREEN)) { hints->flags |= PMinSize | PMaxSize | PBaseSize; - hints->min_width = hints->max_width = hints->base_width = d->w; - hints->min_height = hints->max_height = hints->base_height = d->h; + hints->min_width = hints->max_width = hints->base_width = w; + hints->min_height = hints->max_height = hints->base_height = h; } /* Constrain the window if needed. */ @@ -38,8 +47,8 @@ void _al_xwin_set_size_hints(ALLEGRO_DISPLAY *d, int x_off, int y_off) hints->min_height = (d->min_h > 0) ? d->min_h : 0; hints->max_width = (d->max_w > 0) ? d->max_w : INT_MAX; hints->max_height = (d->max_h > 0) ? d->max_h : INT_MAX; - hints->base_width = d->w; - hints->base_height = d->h; + hints->base_width = w; + hints->base_height = h; } // Tell WMs to respect our chosen position, otherwise the x_off/y_off @@ -57,8 +66,8 @@ void _al_xwin_set_size_hints(ALLEGRO_DISPLAY *d, int x_off, int y_off) * with metacity and kwin. As noted in xdpy_create_display, compiz is just broken. */ hints->flags |= PBaseSize; - hints->base_width = d->w; - hints->base_height = d->h; + hints->base_width = w; + hints->base_height = h; } XSetWMNormalHints(system->x11display, glx->window, hints); hooks/post-receive -- Allegro |