mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-07 10:34:54 -06:00
X11 fixes (PopupEffect, autorepeat issue)
git-svn-id: svn://ultimatepp.org/upp/trunk@804 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
326db13a45
commit
ba67a7807b
4 changed files with 55 additions and 42 deletions
|
|
@ -4,7 +4,7 @@ NAMESPACE_UPP
|
|||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
#define LLOG(x) //DLOG(x)
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
#define LTIMING(x) //TIMING(x)
|
||||
|
||||
|
|
@ -126,18 +126,22 @@ void Ctrl::EventProc(XWindow& w, XEvent *event)
|
|||
while(ev1->type == NoExpose && IsWaitingEvent());
|
||||
LLOG("ev1 type:" << ev1->type << " state:" << ev1->xkey.state <<
|
||||
"keycode:" << ev1->xkey.keycode);
|
||||
if(ev1->type != KeyRelease ||
|
||||
ev1->xkey.state != event->xkey.state ||
|
||||
ev1->xkey.keycode != event->xkey.keycode ||
|
||||
!IsWaitingEvent()) {
|
||||
XPutBackEvent(Xdisplay, ev1);
|
||||
break;
|
||||
if(ev1->type == KeyPress)
|
||||
*ev2 = *ev1;
|
||||
else {
|
||||
if(ev1->type != KeyRelease ||
|
||||
ev1->xkey.state != event->xkey.state ||
|
||||
ev1->xkey.keycode != event->xkey.keycode ||
|
||||
!IsWaitingEvent()) {
|
||||
XPutBackEvent(Xdisplay, ev1);
|
||||
break;
|
||||
}
|
||||
do
|
||||
XNextEvent(Xdisplay, ev2);
|
||||
while(ev2->type == NoExpose && IsWaitingEvent());
|
||||
LLOG("ev2 type:" << ev2->type << " state:" << ev2->xkey.state <<
|
||||
"keycode:" << ev2->xkey.keycode);
|
||||
}
|
||||
do
|
||||
XNextEvent(Xdisplay, ev2);
|
||||
while(ev2->type == NoExpose && IsWaitingEvent());
|
||||
LLOG("ev2 type:" << ev2->type << " state:" << ev2->xkey.state <<
|
||||
"keycode:" << ev2->xkey.keycode);
|
||||
if(ev2->type != KeyPress ||
|
||||
ev2->xkey.state != event->xkey.state ||
|
||||
ev2->xkey.keycode != event->xkey.keycode) {
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ void Ctrl::TimerAndPaint() {
|
|||
}
|
||||
SyncCaret();
|
||||
AnimateCaret();
|
||||
XSync(Xdisplay, false);
|
||||
}
|
||||
|
||||
bool Ctrl::ProcessEvent(bool *)
|
||||
|
|
|
|||
|
|
@ -1239,6 +1239,13 @@ void ChHostSkin()
|
|||
DropEdge_Write(ViewEdge());
|
||||
|
||||
SwapOKCancel_Write(true);
|
||||
|
||||
GUI_GlobalStyle_Write(GUISTYLE_XP);
|
||||
GUI_DragFullWindow_Write(1);
|
||||
GUI_PopUpEffect_Write(Ctrl::IsCompositedGui() ? GUIEFFECT_NONE : GUIEFFECT_SLIDE);
|
||||
GUI_DropShadows_Write(1);
|
||||
GUI_AltAccessKeys_Write(1);
|
||||
GUI_AKD_Conservative_Write(0);
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -15,38 +15,39 @@ void Animate(Ctrl& c, const Rect& target, int type)
|
|||
type = GUI_PopUpEffect();
|
||||
Rect r0 = c.GetRect();
|
||||
dword time0 = GetTickCount();
|
||||
for(;;) {
|
||||
dword t = (GetTickCount() - time0);
|
||||
if(t > 200)
|
||||
break;
|
||||
if(type == GUIEFFECT_SLIDE) {
|
||||
int q = 25 * t / 200;
|
||||
q *= q;
|
||||
Rect r = r0;
|
||||
if(r.left > target.left)
|
||||
r.left = max(r.left - q, target.left);
|
||||
if(r.top > target.top)
|
||||
r.top = max(r.top - q, target.top);
|
||||
if(r.right < target.right)
|
||||
r.right = min(r.right + q, target.right);
|
||||
if(r.bottom < target.bottom)
|
||||
r.bottom = min(r.bottom + q, target.bottom);
|
||||
if(r.GetWidth() > target.GetWidth())
|
||||
r.right = r.left + target.GetWidth();
|
||||
if(r.GetHeight() > target.GetHeight())
|
||||
r.bottom = r.top + target.GetHeight();
|
||||
if(r == target)
|
||||
if(type)
|
||||
for(;;) {
|
||||
dword t = (GetTickCount() - time0);
|
||||
if(t > 200)
|
||||
break;
|
||||
c.SetRect(r);
|
||||
if(type == GUIEFFECT_SLIDE) {
|
||||
int q = 25 * t / 200;
|
||||
q *= q;
|
||||
Rect r = r0;
|
||||
if(r.left > target.left)
|
||||
r.left = max(r.left - q, target.left);
|
||||
if(r.top > target.top)
|
||||
r.top = max(r.top - q, target.top);
|
||||
if(r.right < target.right)
|
||||
r.right = min(r.right + q, target.right);
|
||||
if(r.bottom < target.bottom)
|
||||
r.bottom = min(r.bottom + q, target.bottom);
|
||||
if(r.GetWidth() > target.GetWidth())
|
||||
r.right = r.left + target.GetWidth();
|
||||
if(r.GetHeight() > target.GetHeight())
|
||||
r.bottom = r.top + target.GetHeight();
|
||||
if(r == target)
|
||||
break;
|
||||
c.SetRect(r);
|
||||
}
|
||||
else
|
||||
if(type == GUIEFFECT_FADE)
|
||||
c.SetAlpha((byte)(255 * t / 200));
|
||||
else
|
||||
break;
|
||||
c.Sync();
|
||||
Sleep(0);
|
||||
}
|
||||
else
|
||||
if(type == GUIEFFECT_FADE)
|
||||
c.SetAlpha((byte)(255 * t / 200));
|
||||
else
|
||||
break;
|
||||
c.Sync();
|
||||
Sleep(0);
|
||||
}
|
||||
c.SetRect(target);
|
||||
c.SetAlpha(255);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue