summaryrefslogtreecommitdiffstats
path: root/ui/win32/file_dlg_win32.h
blob: eef7fe389e5b57721b6c4fe4c609273a8ae738f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** @file
 *
 * Native Windows file dialog routines
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 2006 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __FILE_DLG_WIN32_H__
#define __FILE_DLG_WIN32_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
 * @brief set_thread_per_monitor_v2_awareness
 *
 * Qt <= 5.9 supports setting old (Windows 8.1) per-monitor DPI awareness
 * via Qt:AA_EnableHighDpiScaling. We do this in main.cpp. In order for
 * native dialogs to be rendered correctly we need to set per-monitor
 * *v2* awareness prior to creating the dialog, which we can do here.
 * Qt < 5.14(?) or so doesn't render correctly when per-monitor v2 awareness
 * is enabled, so we need to revert our thread context when we're done.
 * Qt >= 6.0 is per-monitor DPI awareness v2 by default, so this doesn't
 * have any effect.
 *
 * @return The current thread DPI awareness context, which should
 * be passed to revert_thread_per_monitor_v2_awareness.
 */
HANDLE set_thread_per_monitor_v2_awareness(void);

/**
 * @brief revert_thread_per_monitor_v2_awareness
 * @param context
 */
void revert_thread_per_monitor_v2_awareness(HANDLE context);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __FILE_DLG_WIN32_H__ */