Cross-platform titlebar (#9405)
This PR reverts https://github.com/zed-industries/zed/pull/9392 and fixes the regressions that led to the reversion. Release Notes: - N/A --------- Co-authored-by: Ezekiel Warren <ezekiel@seaube.com>
This commit is contained in:
parent
44ac6ca45c
commit
328aa2cc95
17 changed files with 719 additions and 156 deletions
|
@ -42,3 +42,29 @@ impl HiLoWord for LPARAM {
|
|||
(self.0 & 0xFFFF) as i16
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) unsafe fn get_window_long(hwnd: HWND, nindex: WINDOW_LONG_PTR_INDEX) -> isize {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
unsafe {
|
||||
GetWindowLongPtrW(hwnd, nindex)
|
||||
}
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
unsafe {
|
||||
GetWindowLongW(hwnd, nindex) as isize
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) unsafe fn set_window_long(
|
||||
hwnd: HWND,
|
||||
nindex: WINDOW_LONG_PTR_INDEX,
|
||||
dwnewlong: isize,
|
||||
) -> isize {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
unsafe {
|
||||
SetWindowLongPtrW(hwnd, nindex, dwnewlong)
|
||||
}
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
unsafe {
|
||||
SetWindowLongW(hwnd, nindex, dwnewlong as i32) as isize
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue