~ubuntu-branches/debian/jessie/italc/jessie

« back to all changes in this revision

Viewing changes to ica/x11/x11vnc/xrandr.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2011-02-11 14:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110211145022-sn173siax6lywjus
Tags: upstream-1.0.13
ImportĀ upstreamĀ versionĀ 1.0.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   Copyright (C) 2002-2010 Karl J. Runge <runge@karlrunge.com> 
 
3
   All rights reserved.
 
4
 
 
5
This file is part of x11vnc.
 
6
 
 
7
x11vnc is free software; you can redistribute it and/or modify
 
8
it under the terms of the GNU General Public License as published by
 
9
the Free Software Foundation; either version 2 of the License, or (at
 
10
your option) any later version.
 
11
 
 
12
x11vnc is distributed in the hope that it will be useful,
 
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with x11vnc; if not, write to the Free Software
 
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
 
20
or see <http://www.gnu.org/licenses/>.
 
21
 
 
22
In addition, as a special exception, Karl J. Runge
 
23
gives permission to link the code of its release of x11vnc with the
 
24
OpenSSL project's "OpenSSL" library (or with modified versions of it
 
25
that use the same license as the "OpenSSL" library), and distribute
 
26
the linked executables.  You must obey the GNU General Public License
 
27
in all respects for all of the code used other than "OpenSSL".  If you
 
28
modify this file, you may extend this exception to your version of the
 
29
file, but you are not obligated to do so.  If you do not wish to do
 
30
so, delete this exception statement from your version.
 
31
*/
 
32
 
1
33
/* -- xrandr.c -- */
2
34
 
3
35
#include "x11vnc.h"
111
143
 
112
144
        RAWFB_RET_VOID
113
145
 
 
146
        /* assumes no X_LOCK */
 
147
 
114
148
        /* sanity check xrandr_mode */
115
149
        if (! xrandr_mode) {
116
150
                xrandr_mode = strdup("default");
152
186
 
153
187
        RAWFB_RET(0)
154
188
 
 
189
        /* it is assumed that X_LOCK is on at this point. */
 
190
 
155
191
        if (subwin) {
156
192
                return handle_subwin_resize(msg);
157
193
        }
162
198
        if (! xrandr && ! xrandr_maybe) {
163
199
                return 0;
164
200
        }
 
201
 
 
202
 
165
203
        if (xrandr_base_event_type && XCheckTypedEvent(dpy,
166
204
            xrandr_base_event_type + RRScreenChangeNotify, &xev)) {
167
205
                int do_change, qout = 0;
172
210
 
173
211
                if (first && ! xrandr) {
174
212
                        fprintf(stderr, "\n");
175
 
                        qout = 1;
 
213
                        if (getenv("X11VNC_DEBUG_XRANDR") == NULL) {
 
214
                                qout = 1;
 
215
                        }
176
216
                }
177
217
                first = 0;
178
218
                        
199
239
 
200
240
                if (wdpy_x == rev->width && wdpy_y == rev->height &&
201
241
                    xrandr_rotation == (int) rev->rotation) {
202
 
                    rfbLog("check_xrandr_event: no change detected.\n");
 
242
                        rfbLog("check_xrandr_event: no change detected.\n");
203
243
                        do_change = 0;
 
244
                        if (! xrandr) {
 
245
                                rfbLog("check_xrandr_event: "
 
246
                                    "enabling full XRANDR trapping anyway.\n");
 
247
                                xrandr = 1;
 
248
                        }
204
249
                } else {
205
250
                        do_change = 1;
206
251
                        if (! xrandr) {
220
265
                XRRUpdateConfiguration(&xev);
221
266
 
222
267
                if (do_change) {
 
268
                        /* under do_change caller normally returns before its X_UNLOCK */
223
269
                        X_UNLOCK;
224
270
                        handle_xrandr_change(rev->width, rev->height);
225
271
                }
230
276
                    XDisplayWidth(dpy, scr), XDisplayHeight(dpy, scr));
231
277
                rfbLog("check_xrandr_event(): returning control to"
232
278
                    " caller...\n");
 
279
 
 
280
 
233
281
                return do_change;
234
282
        }
235
283
#else
236
284
        xev.type = 0;
237
285
#endif
 
286
 
 
287
 
238
288
        return 0;
239
289
}
240
290