~cmiller/ubuntu/trusty/icewm/translations-cause-crash-lp447883

« back to all changes in this revision

Viewing changes to src/movesize.cc

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2009-01-26 00:18:14 UTC
  • mfrom: (1.3.1 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090126001814-ea5ceoy4uroruz72
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
}
204
204
 
205
205
int YFrameWindow::handleMoveKeys(const XKeyEvent &key, int &newX, int &newY) {
206
 
    KeySym k = XKeycodeToKeysym(xapp->display(), key.keycode, 0);
 
206
    KeySym k = XKeycodeToKeysym(xapp->display(), (KeyCode)key.keycode, 0);
207
207
    int m = KEY_MODMASK(key.state);
208
208
    int factor = 1;
209
209
 
251
251
                                   int &newX, int &newY, int &newWidth, int &newHeight,
252
252
                                   int incX, int incY)
253
253
{
254
 
    KeySym k = XKeycodeToKeysym(xapp->display(), key.keycode, 0);
 
254
    KeySym k = XKeycodeToKeysym(xapp->display(), (KeyCode)key.keycode, 0);
255
255
    int m = KEY_MODMASK(key.state);
256
256
    int factor = 1;
257
257
 
263
263
    if (k == XK_Left || k == XK_KP_Left) {
264
264
        if (grabX == 0) {
265
265
            grabX = -1;
266
 
        } else if (grabX == 1) {
 
266
        }
 
267
        if (grabX == 1) {
267
268
            newWidth -= incX * factor;
268
269
        } else if (grabX == -1) {
269
270
            newWidth += incX * factor;
272
273
    } else if (k == XK_Right || k == XK_KP_Right) {
273
274
        if (grabX == 0) {
274
275
            grabX = 1;
275
 
        } else if (grabX == 1) {
 
276
        }
 
277
        if (grabX == 1) {
276
278
            newWidth += incX * factor;
277
279
        } else if (grabX == -1) {
278
280
            newWidth -= incX * factor;
281
283
    } else if (k == XK_Up || k == XK_KP_Up) {
282
284
        if (grabY == 0) {
283
285
            grabY = -1;
284
 
        } else if (grabY == 1) {
 
286
        }
 
287
        if (grabY == 1) {
285
288
            newHeight -= incY * factor;
286
289
        } else if (grabY == -1) {
287
290
            newHeight += incY * factor;
290
293
    } else if (k == XK_Down || k == XK_KP_Down) {
291
294
        if (grabY == 0) {
292
295
            grabY = 1;
293
 
        } else if (grabY == 1) {
 
296
        }
 
297
        if (grabY == 1) {
294
298
            newHeight += incY * factor;
295
299
        } else if (grabY == -1) {
296
300
            newHeight -= incY * factor;
330
334
 
331
335
    if (!(motion.state & ShiftMask)) {
332
336
        if (/*EdgeResistance >= 0 && %%% */ EdgeResistance < 10000) {
333
 
            if (newX + int(width() + n * borderX()) > Mx)
 
337
            if (newX + int(width() + n * borderX()) > Mx) {
334
338
                if (newX + int(width() + n * borderX()) < int(Mx + EdgeResistance))
335
339
                    newX = Mx - width() - n * borderX();
336
340
                else if (motion.state & ShiftMask)
337
341
                    newX -= EdgeResistance;
338
 
            if (newY + int(height() + n * borderY()) > My)
 
342
            }
 
343
            if (newY + int(height() + n * borderY()) > My) {
339
344
                if (newY + int(height() + n * borderY()) < int(My + EdgeResistance))
340
345
                    newY = My - height() - n * borderY();
341
346
                else if (motion.state & ShiftMask)
342
347
                    newY -= EdgeResistance;
343
 
            if (newX < mx)
 
348
            }
 
349
            if (newX < mx) {
344
350
                if (newX > int(- EdgeResistance + mx))
345
351
                    newX = mx;
346
352
                else if (motion.state & ShiftMask)
347
353
                    newX += EdgeResistance;
348
 
            if (newY < my)
 
354
            }
 
355
            if (newY < my) {
349
356
                if (newY > int(- EdgeResistance + my))
350
357
                    newY = my;
351
358
                else if (motion.state & ShiftMask)
352
359
                    newY += EdgeResistance;
 
360
            }
353
361
        }
354
362
        if (EdgeResistance == 10000 || isMaximizedHoriz()) {
355
363
            if (newX + int(width() + n * borderX()) > Mx)
738
746
                break;
739
747
            }
740
748
        } else if (xapp->AltMask != 0) {
741
 
            KeySym k = XKeycodeToKeysym(xapp->display(), key.keycode, 0);
 
749
            KeySym k = XKeycodeToKeysym(xapp->display(), (KeyCode)key.keycode, 0);
742
750
            unsigned int m = KEY_MODMASK(key.state);
743
751
            unsigned int vm = VMod(m);
744
752