git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AcesNative+Usermode - libacessnative "works" (for some definitions)
[tpg/acess2.git]
/
Usermode
/
Applications
/
axwin3_src
/
WM
/
wm_input.c
diff --git
a/Usermode/Applications/axwin3_src/WM/wm_input.c
b/Usermode/Applications/axwin3_src/WM/wm_input.c
index
223dbef
..
858862b
100644
(file)
--- a/
Usermode/Applications/axwin3_src/WM/wm_input.c
+++ b/
Usermode/Applications/axwin3_src/WM/wm_input.c
@@
-34,8
+34,8
@@
tWindow *WM_int_GetWindowAtPos(int X, int Y)
for(win = ret->FirstChild; win; win = win->NextSibling)
{
if( !(win->Flags & WINFLAG_SHOW) ) continue ;
for(win = ret->FirstChild; win; win = win->NextSibling)
{
if( !(win->Flags & WINFLAG_SHOW) ) continue ;
- if( X < win->
X || X >= win->X + win->W )
continue;
- if( Y < win->
Y || Y >= win->Y + win->H )
continue;
+ if( X < win->
RealX || X >= win->RealX + win->RealW )
continue;
+ if( Y < win->
RealY || Y >= win->RealY + win->RealH )
continue;
next_win = win; // Overwrite as we want the final rendered window
}
}
next_win = win; // Overwrite as we want the final rendered window
}
}
@@
-49,8
+49,8
@@
void WM_Input_MouseMoved(int OldX, int OldY, int NewX, int NewY)
struct sWndMsg_MouseMove msg;
win = WM_int_GetWindowAtPos(OldX, OldY);
struct sWndMsg_MouseMove msg;
win = WM_int_GetWindowAtPos(OldX, OldY);
- msg.X = NewX - win->X - win->BorderL;
- msg.Y = NewY - win->Y - win->BorderT;
+ msg.X = NewX - win->
Real
X - win->BorderL;
+ msg.Y = NewY - win->
Real
Y - win->BorderT;
msg.dX = NewX - OldX;
msg.dY = NewY - OldY;
WM_SendMessage(NULL, win, WNDMSG_MOUSEMOVE, sizeof(msg), &msg);
msg.dX = NewX - OldX;
msg.dY = NewY - OldY;
WM_SendMessage(NULL, win, WNDMSG_MOUSEMOVE, sizeof(msg), &msg);
@@
-64,8
+64,8
@@
void WM_Input_MouseMoved(int OldX, int OldY, int NewX, int NewY)
// TODO: Send mouseup to match mousedown if the cursor moves out of a window?
win = newWin;
// TODO: Send mouseup to match mousedown if the cursor moves out of a window?
win = newWin;
- msg.X = NewX - win->X - win->BorderL;
- msg.Y = NewY - win->Y - win->BorderT;
+ msg.X = NewX - win->
Real
X - win->BorderL;
+ msg.Y = NewY - win->
Real
Y - win->BorderT;
msg.dX = NewX - OldX;
msg.dY = NewY - OldY;
WM_SendMessage(NULL, win, WNDMSG_MOUSEMOVE, sizeof(msg), &msg);
msg.dX = NewX - OldX;
msg.dY = NewY - OldY;
WM_SendMessage(NULL, win, WNDMSG_MOUSEMOVE, sizeof(msg), &msg);
@@
-75,8
+75,8
@@
void WM_Input_int_SendBtnMsg(tWindow *Win, int X, int Y, int Index, int Pressed)
{
struct sWndMsg_MouseButton msg;
{
struct sWndMsg_MouseButton msg;
- msg.X = X - Win->X - Win->BorderL;
- msg.Y = Y - Win->Y - Win->BorderT;
+ msg.X = X - Win->
Real
X - Win->BorderL;
+ msg.Y = Y - Win->
Real
Y - Win->BorderT;
msg.Button = Index;
msg.bPressed = !!Pressed;
msg.Button = Index;
msg.bPressed = !!Pressed;
@@
-94,7
+94,12
@@
void WM_Input_MouseButton(int X, int Y, int ButtonIndex, int Pressed)
{
// _SysDebug("Gave focus to %p", win);
WM_FocusWindow(win);
{
// _SysDebug("Gave focus to %p", win);
WM_FocusWindow(win);
- WM_RaiseWindow(win);
+ tWindow *tmpwin = win;
+ while( tmpwin )
+ {
+ WM_RaiseWindow(tmpwin);
+ tmpwin = tmpwin->Parent;
+ }
}
// Make sure that even if the mouse has moved out of the original window,
}
// Make sure that even if the mouse has moved out of the original window,
@@
-129,8
+134,6
@@
void WM_Input_KeyFire(uint32_t Character, uint32_t Scancode)
// TODO: Properly translate into KeySyms and Unicode
// TODO: Properly translate into KeySyms and Unicode
- // TODO: Shortcuts
-
msg.KeySym = Scancode;
msg.UCS32 = Character;
WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYFIRE, sizeof(msg), &msg);
msg.KeySym = Scancode;
msg.UCS32 = Character;
WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYFIRE, sizeof(msg), &msg);
UCC
git Repository :: git.ucc.asn.au