A generic touchscreen calibration program for X.Org
Revisão | 6e5a9b64e9733193ab094357e947c749efa31fd6 (tree) |
---|---|
Hora | 2012-07-05 16:58:37 |
Autor | Tias Guns <tias@ulys...> |
Commiter | Tias Guns |
Revert "take rotation into account when calculating display size"
This reverts commit 0aabb155d351656bbb804619279dd497b06c48b0.
@@ -95,12 +95,7 @@ GuiCalibratorX11::GuiCalibratorX11(Calibrator* calibrator0) | ||
95 | 95 | int nsizes; |
96 | 96 | XRRScreenSize* randrsize = XRRSizes(display, screen_num, &nsizes); |
97 | 97 | if (nsizes != 0) { |
98 | - Rotation current = 0; | |
99 | - XRRRotations(display, screen_num, ¤t); | |
100 | - bool rot = current & RR_Rotate_90 || current & RR_Rotate_270; | |
101 | - int width = rot ? randrsize->height : randrsize->width; | |
102 | - int height = rot ? randrsize->width : randrsize->height; | |
103 | - set_display_size(width, height); | |
98 | + set_display_size(randrsize->width, randrsize->height); | |
104 | 99 | } else { |
105 | 100 | set_display_size(DisplayWidth(display, screen_num), |
106 | 101 | DisplayHeight(display, screen_num)); |
@@ -188,31 +183,17 @@ void GuiCalibratorX11::set_display_size(int width, int height) { | ||
188 | 183 | |
189 | 184 | void GuiCalibratorX11::redraw() |
190 | 185 | { |
191 | - if (calibrator->get_geometry() == NULL) { | |
192 | - int width; | |
193 | - int height; | |
194 | 186 | #ifdef HAVE_X11_XRANDR |
187 | + if (calibrator->get_geometry() == NULL) { | |
195 | 188 | // check that screensize did not change |
196 | 189 | int nsizes; |
197 | 190 | XRRScreenSize* randrsize = XRRSizes(display, screen_num, &nsizes); |
198 | - if (nsizes != 0) { | |
199 | - Rotation current = 0; | |
200 | - XRRRotations(display, screen_num, ¤t); | |
201 | - bool rot = current & RR_Rotate_90 || current & RR_Rotate_270; | |
202 | - width = rot ? randrsize->height : randrsize->width; | |
203 | - height = rot ? randrsize->width : randrsize->height; | |
204 | - } else { | |
205 | - width = DisplayWidth(display, screen_num); | |
206 | - height = DisplayHeight(display, screen_num); | |
207 | - } | |
208 | -#else | |
209 | - width = DisplayWidth(display, screen_num); | |
210 | - height = DisplayHeight(display, screen_num); | |
211 | -#endif | |
212 | - if (display_width != width || display_height != height) { | |
213 | - set_display_size(width, height); | |
191 | + if (nsizes != 0 && (display_width != randrsize->width || | |
192 | + display_height != randrsize->height)) { | |
193 | + set_display_size(randrsize->width, randrsize->height); | |
214 | 194 | } |
215 | 195 | } |
196 | +#endif | |
216 | 197 | |
217 | 198 | // Print the text |
218 | 199 | int text_height = font_info->ascent + font_info->descent; |