Skip to content

Commit a5f6b6d

Browse files
committed
a few things
- account for monitor bounds properly on macos - error early when attempting hardware decoding - fix updater bundle publishing
1 parent 5ba6f64 commit a5f6b6d

File tree

8 files changed

+196
-135
lines changed

8 files changed

+196
-135
lines changed

Cargo.lock

Lines changed: 14 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
},
3636
"bundle": {
3737
"active": true,
38+
"createUpdaterArtifacts": true,
3839
"targets": "all",
3940
"icon": [
4041
"icons/32x32.png",

apps/desktop/src-tauri/tauri.prod.conf.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
}
1818
},
1919
"bundle": {
20-
"createUpdaterArtifacts": true,
2120
"macOS": {
2221
"entitlements": "Entitlements.plist"
2322
},

apps/desktop/src/routes/(window-chrome)/(main).tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useQueryClient,
88
} from "@tanstack/solid-query";
99
import { getVersion } from "@tauri-apps/api/app";
10-
import { getCurrentWindow } from "@tauri-apps/api/window";
10+
import { availableMonitors, getCurrentWindow } from "@tauri-apps/api/window";
1111
import { LogicalSize } from "@tauri-apps/api/window";
1212
import { cx } from "cva";
1313
import {

crates/ffmpeg-hw-device/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,17 @@ impl CodecContextExt for codec::decoder::decoder::Decoder {
8484
return Err("no hw config");
8585
};
8686

87-
HW_PIX_FMT.set((*hw_config).pix_fmt);
88-
89-
let context = self.as_mut_ptr();
90-
91-
(*context).get_format = Some(get_format);
92-
9387
let mut hw_device_ctx = null_mut();
9488

9589
if av_hwdevice_ctx_create(&mut hw_device_ctx, device_type, null(), null_mut(), 0) < 0 {
9690
return Err("failed to create hw device context");
9791
}
9892

93+
HW_PIX_FMT.set((*hw_config).pix_fmt);
94+
95+
let context = self.as_mut_ptr();
96+
97+
(*context).get_format = Some(get_format);
9998
(*context).hw_device_ctx = av_buffer_ref(hw_device_ctx);
10099

101100
Ok(HwDevice {

crates/media/src/platform/macos.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core_foundation::{
88
};
99
use core_graphics::{
1010
base::boolean_t,
11-
display::{CFArrayGetValueAtIndex, CFDictionaryRef, CGRect},
11+
display::{CFArrayGetValueAtIndex, CFDictionaryRef, CGDisplay, CGDisplayBounds, CGRect},
1212
window::{
1313
kCGNullWindowID, kCGWindowBounds, kCGWindowLayer, kCGWindowListExcludeDesktopElements,
1414
kCGWindowListOptionOnScreenOnly, kCGWindowName, kCGWindowNumber, kCGWindowOwnerName,
@@ -370,3 +370,19 @@ pub fn display_for_window(
370370

371371
None
372372
}
373+
374+
pub fn primary_monitor_bounds() -> Bounds {
375+
let display = CGDisplay::main();
376+
let height = display.pixels_high();
377+
let width = display.pixels_wide();
378+
let bounds = unsafe { CGDisplayBounds(display.id) };
379+
380+
dbg!(bounds);
381+
382+
Bounds {
383+
x: bounds.origin.x,
384+
y: bounds.origin.y,
385+
width: width as f64,
386+
height: height as f64,
387+
}
388+
}

0 commit comments

Comments
 (0)