Este site funciona melhor com JavaScript.
Página inicial
Explorar
Ajuda
Acessar
Immanuel
/
sxiv
Observar
1
Favorito
0
Fork
0
Código
Issues
0
Pull requests
0
Versões
0
Wiki
Atividade
Ver código fonte
Merge pointer warping in i_drag from Rob Pilling
master
Bert Münnich
12 anos atrás
pai
408b75a0b4
c8fcc3d354
commit
ce8460108a
1 arquivos alterados
com
22 adições
e
3 exclusões
Visão dividida
Opções de diferenças
Mostrar estatísticas
Baixar arquivo de patch
Baixar arquivo de diferenças
+22
-3
commands.c
+ 22
- 3
commands.c
Ver arquivo
@@ -289,10 +289,29 @@ bool i_drag(arg_t a)
case MotionNotify:
x = e.xmotion.x;
y = e.xmotion.y;
if (x >= 0 && x <= win.w && y >= 0 && y <= win.h) {
dx += x - ox;
dy += y - oy;
#define WARP(x, y) \
XWarpPointer(win.env.dpy, \
None, win.xwin, \
0, 0, 0, 0, \
x, y); \
ox = x, oy = y; \
break
/* wrap the mouse around */
if(x < 0){
WARP(win.w, y);
}else if(x > win.w){
WARP(0, y);
}else if(y < 0){
WARP(x, win.h);
}else if(y > win.h){
WARP(x, 0);
}
dx += x - ox;
dy += y - oy;
ox = x;
oy = y;
break;
Escrever
Pré-visualização
Carregando…
Cancelar
Salvar