From 20c352c7c9d6b154d72fe01911579e263e0480bb Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Mon, 1 Jun 2026 10:04:11 +0200 Subject: [PATCH] CtrlCore: Fixed to compile in Linux --- uppsrc/CtrlCore/CocoWin.mm | 7 ------- uppsrc/CtrlCore/GtkEvent.cpp | 3 --- uppsrc/CtrlCore/GtkWnd.cpp | 7 ------- uppsrc/CtrlCore/X11DHCtrl.cpp | 1 - uppsrc/CtrlCore/X11Wnd.cpp | 31 +------------------------------ 5 files changed, 1 insertion(+), 48 deletions(-) diff --git a/uppsrc/CtrlCore/CocoWin.mm b/uppsrc/CtrlCore/CocoWin.mm index b87931086..783eadc3c 100644 --- a/uppsrc/CtrlCore/CocoWin.mm +++ b/uppsrc/CtrlCore/CocoWin.mm @@ -209,13 +209,6 @@ void Ctrl::WndInvalidateRect(const Rect& r) } } -void Ctrl::WndScrollView(const Rect& r, int dx, int dy) -{ - GuiLock __; - LLOG("Scroll View " << r); - WndInvalidateRect(r); -} - bool Ctrl::IsWndOpen() const { GuiLock __; // DLOG("IsWndOpen " << Upp::Name(this) << ": " << (bool)top); diff --git a/uppsrc/CtrlCore/GtkEvent.cpp b/uppsrc/CtrlCore/GtkEvent.cpp index 6925a6361..4fbba1d72 100644 --- a/uppsrc/CtrlCore/GtkEvent.cpp +++ b/uppsrc/CtrlCore/GtkEvent.cpp @@ -963,9 +963,6 @@ bool Ctrl::ProcessEvents0(bool *quit, bool fetch) AnimateCaret(); if(quit) *quit = IsEndSession(); - for(int i = 0; i < wins.GetCount(); i++) - if(wins[i].ctrl) - wins[i].ctrl->SyncScroll(); ProcessInvalids(); FetchEvents(FALSE); // To perform any pending GDK_EXPOSE gdk_display_flush(gdk_display_get_default()); diff --git a/uppsrc/CtrlCore/GtkWnd.cpp b/uppsrc/CtrlCore/GtkWnd.cpp index e644fa456..302d9bcad 100644 --- a/uppsrc/CtrlCore/GtkWnd.cpp +++ b/uppsrc/CtrlCore/GtkWnd.cpp @@ -532,13 +532,6 @@ void Ctrl::WndInvalidateRect(const Rect& r) } } -void Ctrl::WndScrollView(const Rect& r, int dx, int dy) -{ - GuiLock __; - LLOG("ScrollView " << rect); - WndInvalidateRect(r); -} - bool Ctrl::SweepConfigure(bool wait) { Ptr this_ = this; diff --git a/uppsrc/CtrlCore/X11DHCtrl.cpp b/uppsrc/CtrlCore/X11DHCtrl.cpp index 6b43610eb..c41bc528e 100644 --- a/uppsrc/CtrlCore/X11DHCtrl.cpp +++ b/uppsrc/CtrlCore/X11DHCtrl.cpp @@ -21,7 +21,6 @@ DHCtrl::DHCtrl() UserVisualInfo = 0; // No background painting - backpaint = NOBACKPAINT; // transparent = true; hwnd = 0; } // END Constructor class DHCtrl diff --git a/uppsrc/CtrlCore/X11Wnd.cpp b/uppsrc/CtrlCore/X11Wnd.cpp index b44ebc6c8..4f9f8b00a 100644 --- a/uppsrc/CtrlCore/X11Wnd.cpp +++ b/uppsrc/CtrlCore/X11Wnd.cpp @@ -50,8 +50,6 @@ Ptr Ctrl::popupWnd; Point Ctrl::mousePos; -static int s_starttime; - void Ctrl::DoPaint(const Vector& invalid) { GuiLock __; @@ -72,27 +70,6 @@ void Ctrl::DoPaint(const Vector& invalid) } } -void Ctrl::WndScrollView(const Rect& r, int dx, int dy) -{ - GuiLock __; - if(r.IsEmpty() || !GetWindow()) return; - int cx = r.Width() - abs(dx); - int cy = r.Height() - abs(dy); - GC gc = XCreateGC(Xdisplay, GetWindow(), 0, 0); - XCopyArea(Xdisplay, GetWindow(), GetWindow(), gc, - r.left + max(-dx, 0), r.top + max(-dy, 0), cx, cy, - r.left + max(dx, 0), r.top + max(dy, 0)); - XFreeGC(Xdisplay, gc); - XWindow *xw = GetXWindow(); - Vector ur; - if(xw) - for(int i = 0; i < xw->invalid.GetCount(); i++) - if(xw->invalid[i].Intersects(r)) - ur.Add(xw->invalid[i]); - for(int i = 0; i < ur.GetCount(); i++) - Invalidate(*xw, ur[i].Offseted(dx, dy)); -} - bool Ctrl::IsWaitingEvent() { ASSERT_(IsMainThread(), "IsWaitingEvent can only run in the main thread"); @@ -305,11 +282,8 @@ void Ctrl::ProcessEvent(XEvent *event) return; } XWindow& w = xmap[q]; - if(w.ctrl) { + if(w.ctrl) w.ctrl->EventProc(w, event); - if(w.ctrl) - w.ctrl->SyncMoves(); - } else xmap.SetKey(q, None); DefferedFocusSync(); @@ -332,7 +306,6 @@ void Ctrl::TimerAndPaint() { if(Xwindow().GetKey(i) && xw.exposed && xw.invalid.GetCount()) { if(xw.ctrl) { LLOG("..and paint " << UPP::Name(xw.ctrl)); - xw.ctrl->SyncScroll(); Vector x = pick(xw.invalid); xw.invalid.Clear(); xw.ctrl->DoPaint(x); @@ -721,7 +694,6 @@ void Ctrl::WndUpdate() if(!xwin) return; XWindow& xw = Xwindow().Get(xwin); if(xw.exposed && xw.invalid.GetCount()) { - SyncScroll(); DoPaint(xw.invalid); xw.invalid.Clear(); LTIMING("WndUpdate XSync"); @@ -740,7 +712,6 @@ void Ctrl::WndUpdate(const Rect& r) if(!xwin) return; XWindow& xw = Xwindow().Get(xwin); bool dummy; - SyncScroll(); DoPaint(Intersect(xw.invalid, r, dummy)); LTIMING("WndUpdate XSync"); XSync(Xdisplay, false);