Compare commits

...

3 Commits

Author SHA1 Message Date
Selva Nair 44288aae4b Change WM_RBUTTONUP to WM_CONTEXTMENU
Required for correct behavior under right click as well as
keyboard event (Shift-F10) for context menu.

The location of the context menu is now taken from the
message as the cursor position may not match when triggered by
keyboard event.

Fixes Github #763

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2025-09-09 09:28:09 +03:00
Frank Lichtenheld ea13106cf6 Bump version to 11.55.0.0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2025-07-31 15:46:00 +02:00
justwho 66eec353e3 Update openvpn-gui-res-zh-hans.rc 2025-07-21 10:32:23 +03:00
5 changed files with 11 additions and 8 deletions

View File

@ -20,7 +20,7 @@ dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AC_PREREQ(2.59) AC_PREREQ(2.59)
define([_GUI_VERSION_MAJOR], [11]) define([_GUI_VERSION_MAJOR], [11])
define([_GUI_VERSION_MINOR], [54]) define([_GUI_VERSION_MINOR], [55])
AC_INIT([OpenVPN GUI],[_GUI_VERSION_MAJOR],[openvpn-devel@lists.sourceforge.net],[openvpn-gui],[https://github.com/openvpn/openvpn-gui/]) AC_INIT([OpenVPN GUI],[_GUI_VERSION_MAJOR],[openvpn-devel@lists.sourceforge.net],[openvpn-gui],[https://github.com/openvpn/openvpn-gui/])
AC_DEFINE([PACKAGE_VERSION_RESOURCE], [_GUI_VERSION_MAJOR,_GUI_VERSION_MINOR,0,0], [Version in windows resource format]) AC_DEFINE([PACKAGE_VERSION_RESOURCE], [_GUI_VERSION_MAJOR,_GUI_VERSION_MINOR,0,0], [Version in windows resource format])
AC_DEFINE([PACKAGE_VERSION_RESOURCE_STR], ["_GUI_VERSION_MAJOR._GUI_VERSION_MINOR.0.0"], [Version as a string]) AC_DEFINE([PACKAGE_VERSION_RESOURCE_STR], ["_GUI_VERSION_MAJOR._GUI_VERSION_MINOR.0.0"], [Version as a string])

4
main.c
View File

@ -513,7 +513,7 @@ HandleCopyDataMessage(const COPYDATASTRUCT *copy_data)
} }
else if (copy_data->dwData == WM_OVPN_RESCAN) else if (copy_data->dwData == WM_OVPN_RESCAN)
{ {
OnNotifyTray(WM_OVPN_RESCAN); OnNotifyTray(0, WM_OVPN_RESCAN);
} }
else else
{ {
@ -653,7 +653,7 @@ WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break; break;
case WM_NOTIFYICONTRAY: case WM_NOTIFYICONTRAY:
OnNotifyTray(lParam); /* Manages message from tray */ OnNotifyTray(wParam, lParam); /* Manages message from tray */
break; break;
case WM_COPYDATA: /* custom messages with data from other processes */ case WM_COPYDATA: /* custom messages with data from other processes */

View File

@ -314,7 +314,7 @@ FONT 8, "Segoe UI"
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
BEGIN BEGIN
CONTROL "", ID_STATIC_QR, "Static", SS_BITMAP | WS_VISIBLE | SS_CENTERIMAGE, 0, 0, 10, 10 CONTROL "", ID_STATIC_QR, "Static", SS_BITMAP | WS_VISIBLE | SS_CENTERIMAGE, 0, 0, 10, 10
LTEXT "Scan this QR code on your mobile to proceed with authentication.", ID_TXT_QR, 0, 0, 10, 10, SS_CENTER | WS_VISIBLE | SS_EDITCONTROL LTEXT "在您的手机上扫描这个二维码以进行身份验证。", ID_TXT_QR, 0, 0, 10, 10, SS_CENTER | WS_VISIBLE | SS_EDITCONTROL
END END
STRINGTABLE STRINGTABLE

9
tray.c
View File

@ -427,17 +427,20 @@ PositionTrayToolTip(LONG x, LONG y)
* Handle mouse clicks on tray icon * Handle mouse clicks on tray icon
*/ */
void void
OnNotifyTray(LPARAM lParam) OnNotifyTray(WPARAM wParam, LPARAM lParam)
{ {
POINT pt; POINT pt;
/* Use LOWORD(lParam) as HIWORD() contains the icon id if uVersion >= 4 */ /* Use LOWORD(lParam) as HIWORD() contains the icon id if uVersion >= 4 */
switch (LOWORD(lParam)) switch (LOWORD(lParam))
{ {
case WM_RBUTTONUP: case WM_CONTEXTMENU:
RecreatePopupMenus(); RecreatePopupMenus();
/* wParam contains the upper left corner of the anchor point */
pt.x = (int)LOWORD(wParam);
pt.y = (int)HIWORD(wParam);
GetCursorPos(&pt);
SetForegroundWindow(o.hWnd); SetForegroundWindow(o.hWnd);
TrackPopupMenu(hMenu, TPM_RIGHTALIGN, pt.x, pt.y, 0, o.hWnd, NULL); TrackPopupMenu(hMenu, TPM_RIGHTALIGN, pt.x, pt.y, 0, o.hWnd, NULL);
PostMessage(o.hWnd, WM_NULL, 0, 0); PostMessage(o.hWnd, WM_NULL, 0, 0);

2
tray.h
View File

@ -49,7 +49,7 @@ void RecreatePopupMenus(void);
void CreatePopupMenus(); void CreatePopupMenus();
void OnNotifyTray(LPARAM); void OnNotifyTray(WPARAM, LPARAM);
void OnDestroyTray(void); void OnDestroyTray(void);