*/}}
1
0
Преглед на файлове

Adapting windows problems.

ChengduLittleA преди 1 година
родител
ревизия
c65d438f35
променени са 2 файла, в които са добавени 12 реда и са изтрити 7 реда
  1. 10 6
      la_kernel.c
  2. 2 1
      resources/la_templates.c

+ 10 - 6
la_kernel.c

@@ -1152,11 +1152,13 @@ void la_CommandResizeWindow(SYSWINDOW hwnd, int x, int y, int w, int h){
     laWindow *window = lstFindItem(hwnd, la_IsThisSysWindow, &MAIN.Windows);
     if (!window) return;
 #ifdef _WIN32
-    RECT rc; GetClientRect(window->win, &rc);
-    window->CW = rc.right - rc.left;
-    window->CH = rc.bottom - rc.top;
-    window->W = window->CW; window->H = window->CH;
-    window->X = rc.left; window->Y = rc.top;
+    RECT rcc; GetClientRect(window->win, &rcc);
+    RECT rcw; GetWindowRect(window->win, &rcw);
+    window->CW = rcc.right - rcc.left;
+    window->CH = rcc.bottom - rcc.top;
+    window->W = rcw.right - rcw.left;
+    window->H = rcw.bottom - rcw.top;
+    window->X = rcw.left; window->Y = rcw.top;
 #endif
 #ifdef __linux__
     XWindowAttributes attr;
@@ -6774,9 +6776,10 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
     case WM_MBUTTONUP:   la_SendMouseEvent(hwnd, LA_M_MOUSE_UP, PARAM_2_FROM(lparam)); break;
 
     case WM_MOUSEWHEEL:
+        POINT p; p.x=LOWORD(lparam); p.y=HIWORD(lparam); ScreenToClient(hwnd,&p);
         if ((wheelmark = HIWORD(wparam)) > 0) WheelDir = LA_MOUSEUP;
         else if ((wheelmark = HIWORD(wparam)) < 0) WheelDir = LA_MOUSEDOWN;
-        la_SendMouseEvent(hwnd, WheelDir|LA_KEY_MOUSE_SCROLL, PARAM_2_FROM(lparam));
+        la_SendMouseEvent(hwnd, WheelDir|LA_KEY_MOUSE_SCROLL, p.x, p.y);
         break;
     case WT_PACKET:
         if (!MAIN.InkOrWinTab) { break; /* Use Windows Ink. */ }
@@ -6804,6 +6807,7 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
         break;
     case WM_SIZE:
         if (wparam == SIZE_MINIMIZED) break;
+    case WM_MOVE: /* And size */
         la_CommandResizeWindow(hwnd, 0, 0, LOWORD(lparam), HIWORD(lparam));
         break;
     case WM_POINTERUPDATE:

+ 2 - 1
resources/la_templates.c

@@ -1269,7 +1269,8 @@ void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorIn
 
             laShowLabel(muil, mc, "Wacom Devices:", 0, 0);
 #ifdef _WIN32
-            b=laBeginRow(muil,mcl,0,0); laShowLabel(muil, mcl, "Driver:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
+            b=laBeginRow(muil,mcl,0,0); laShowSeparator(muil,mcl)->Expand=1;
+            laShowLabel(muil, mcl, "Driver:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
             laShowItem(muil, mcl, 0, "LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
             laEndRow(muil, b);
             laShowItem(muil, mcr, 0, "la.user_preferences.wacom_driver");