Skip to content

Commit

Permalink
Revert "take rotation into account when calculating display size"
Browse files Browse the repository at this point in the history
This reverts commit 0aabb15.
  • Loading branch information
tias committed Jul 5, 2012
1 parent 9b0803b commit 6e5a9b6
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions src/gui/x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ GuiCalibratorX11::GuiCalibratorX11(Calibrator* calibrator0)
int nsizes;
XRRScreenSize* randrsize = XRRSizes(display, screen_num, &nsizes);
if (nsizes != 0) {
Rotation current = 0;
XRRRotations(display, screen_num, &current);
bool rot = current & RR_Rotate_90 || current & RR_Rotate_270;
int width = rot ? randrsize->height : randrsize->width;
int height = rot ? randrsize->width : randrsize->height;
set_display_size(width, height);
set_display_size(randrsize->width, randrsize->height);
} else {
set_display_size(DisplayWidth(display, screen_num),
DisplayHeight(display, screen_num));
Expand Down Expand Up @@ -188,31 +183,17 @@ void GuiCalibratorX11::set_display_size(int width, int height) {

void GuiCalibratorX11::redraw()
{
if (calibrator->get_geometry() == NULL) {
int width;
int height;
#ifdef HAVE_X11_XRANDR
if (calibrator->get_geometry() == NULL) {
// check that screensize did not change
int nsizes;
XRRScreenSize* randrsize = XRRSizes(display, screen_num, &nsizes);
if (nsizes != 0) {
Rotation current = 0;
XRRRotations(display, screen_num, &current);
bool rot = current & RR_Rotate_90 || current & RR_Rotate_270;
width = rot ? randrsize->height : randrsize->width;
height = rot ? randrsize->width : randrsize->height;
} else {
width = DisplayWidth(display, screen_num);
height = DisplayHeight(display, screen_num);
}
#else
width = DisplayWidth(display, screen_num);
height = DisplayHeight(display, screen_num);
#endif
if (display_width != width || display_height != height) {
set_display_size(width, height);
if (nsizes != 0 && (display_width != randrsize->width ||
display_height != randrsize->height)) {
set_display_size(randrsize->width, randrsize->height);
}
}
#endif

// Print the text
int text_height = font_info->ascent + font_info->descent;
Expand Down

0 comments on commit 6e5a9b6

Please sign in to comment.