Skip to content

Commit

Permalink
fix(cliprdr-native): handle WM_ACTIVATEAPP in clipboard_subproc (#…
Browse files Browse the repository at this point in the history
…657)

This PR adds handling of `WM_ACTIVATEAPP` in `clipboard_subproc`.
Previously, the function handled only `WM_ACTIVATE`.
  • Loading branch information
RRRadicalEdward authored Feb 3, 2025
1 parent 2a5e783 commit 9b2926e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/ironrdp-cliprdr-native/src/windows/clipboard_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use windows::Win32::Foundation::{HWND, LPARAM, LRESULT, WPARAM};
use windows::Win32::System::DataExchange::GetClipboardOwner;
use windows::Win32::UI::Shell::DefSubclassProc;
use windows::Win32::UI::WindowsAndMessaging::{
KillTimer, SetTimer, WA_INACTIVE, WM_ACTIVATE, WM_CLIPBOARDUPDATE, WM_DESTROY, WM_RENDERALLFORMATS,
KillTimer, SetTimer, WA_INACTIVE, WM_ACTIVATE, WM_ACTIVATEAPP, WM_CLIPBOARDUPDATE, WM_DESTROY, WM_RENDERALLFORMATS,
WM_RENDERFORMAT, WM_TIMER,
};

Expand Down Expand Up @@ -328,7 +328,7 @@ pub(crate) unsafe extern "system" fn clipboard_subproc(

match msg {
// We need to keep track of window state to distinguish between local and remote copy
WM_ACTIVATE => ctx.window_is_active = wparam.0 != WA_INACTIVE as usize, // `as` conversion is fine for constants
WM_ACTIVATE | WM_ACTIVATEAPP => ctx.window_is_active = wparam.0 != WA_INACTIVE as usize, // `as` conversion is fine for constants
// Sent by the OS when OS clipboard content is changed
WM_CLIPBOARDUPDATE => {
// SAFETY: `GetClipboardOwner` is always safe to call.
Expand Down

0 comments on commit 9b2926e

Please sign in to comment.