Use Shell_NotifyGetRect to find the icon location and place the
tip window a fixed distance above/below it.
It appears GUID_NULL used for above is not pulled in by shellapi.h.
Define locally when absent.
Also add TTF_RTLREADING for RTL languages. How to right justify
as well in this case is unclear.
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Built-in tray notification icon has a tip text length limit of 128
characters which is often limited for showing the connected profile name,
connected since time and IP addresses. If the profile name is long the IP
numbers could get truncated.
Fix by using a custom tooltip window and display it when mouse hovers over
the icon. As the status bar need not be at the bottom of the screen (could be
at right, left or top as well), the location of the window is chosen based
on the mouse co-ordinates that trigger the hover event.
In case of errors while setting up the tooltip window, fall back to the current
behaviour.
If the message is too long to include time and IP, truncate the profile name
part of the message.
v2: Do not use wParam in NIN_POPUOPEN message as it does not seem to work
on Windows 11. Instead use GetCursorPos() for mouse location.
Fixes issue #666
Signed-off-by: Selva Nair <selva.nair@gmail.com>
The tray icon and its tip text get updated to the connecting state when starting
a new status window thread. This is not enough for persistent connections as these
can be restarted from the hold state which does not go through a new thread creation.
To see the bug, disconnect and reconnect a persistent connection and have it wait in the
connecting state. The tray icon colour does not change to yellow and the tray tip message
does not show the "Connecting to:" text.
Fix by ensuring that CheckAndSetTrayIcon() or SetTrayIcon() gets called whenever a state
change message is received.
Fixes issue #668
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Add ASAN build configuration, based on debug with ASAN
enabled. This might help finding crashes like in
https://github.com/OpenVPN/openvpn-gui/issues/548
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Since we use Visual Studio as generator, CMAKE_BUILD_TYPE doesn't make
sense, since configuration (release/debug) is specified on build step,
not configure step.
Signed-off-by: Lev Stipakov <lev@openvpn.net>
There is no point in localizing "OpenVPN GUI"
tray icon tooltip. Remove it from resources and
replace with PACKAGE_NAME define.
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Switches to vcpkg-caching instead of directory caching.
While here, don't explicitely export VCPKG_ROOT.
run-vcpkg already takes care of that.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
- The policy setting is checked when GUI is started. Any change
in policy will be effective only after restarting the GUI.
Signed-off-by: Selva Nair <selva.nair@gmail.com>
- Only "hot" user input -- i.e, freshly typed password starting
from an empty string, with keyboard focus still in the edit
box -- can be revealed.
In particular, prefilled passwod (from cached value) cannot be
revealed.
- Once keyboard focus moves out of the password edit box, the inpit has
to be deleted for the reveal feature to get re-enabled.
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Commit 2b1e586
"Replace Sleep by a Wait function that pumps messages"
replaced Sleep() with a wait function which also processes messages.
However WM_MANAGEMENT message in some cases requires actual delay to be
processed. To achieve that, bring back original Sleep().
Signed-off-by: Lev Stipakov <lev@openvpn.net>
- commit f8a243fbe introduced removing the tray icon during
the wait for exit to avoid further user interaction. This
is done in StopAllOpenVPN(). However, this function is also
reused for processing WM_OVPN_STOPALL message received from
a second instance via --comamnd disconnect_all. In this case
the tray icon should not be removed as we are not exiting.
Fixes issue #607
Signed-off-by: Selva Nair <selva.nair@gmail.com>