mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:08:32 +02:00
Fix window title moving stoplights (for now)
This commit is contained in:
@@ -840,6 +840,8 @@ fn create_window(handle: &AppHandle<Wry>, url: Option<&str>) -> Window<Wry> {
|
|||||||
match e {
|
match e {
|
||||||
WindowEvent::Resized(..) => apply_offset(),
|
WindowEvent::Resized(..) => apply_offset(),
|
||||||
WindowEvent::ThemeChanged(..) => apply_offset(),
|
WindowEvent::ThemeChanged(..) => apply_offset(),
|
||||||
|
WindowEvent::Focused(..) => apply_offset(),
|
||||||
|
WindowEvent::ScaleFactorChanged { .. } => apply_offset(),
|
||||||
WindowEvent::CloseRequested { .. } => {
|
WindowEvent::CloseRequested { .. } => {
|
||||||
println!("CLOSE REQUESTED");
|
println!("CLOSE REQUESTED");
|
||||||
// api.prevent_close();
|
// api.prevent_close();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub trait TrafficLightWindowExt {
|
|||||||
impl<R: Runtime> TrafficLightWindowExt for Window<R> {
|
impl<R: Runtime> TrafficLightWindowExt for Window<R> {
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
fn position_traffic_lights(&self) {
|
fn position_traffic_lights(&self) {
|
||||||
// No-op
|
// No-op on other platforms
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { appWindow } from '@tauri-apps/api/window';
|
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { fallbackRequestName } from '../lib/fallbackRequestName';
|
import { fallbackRequestName } from '../lib/fallbackRequestName';
|
||||||
import { useActiveEnvironment } from './useActiveEnvironment';
|
import { useActiveEnvironment } from './useActiveEnvironment';
|
||||||
@@ -17,6 +16,9 @@ export function useSyncWindowTitle() {
|
|||||||
if (activeRequest) {
|
if (activeRequest) {
|
||||||
newTitle += ` – ${fallbackRequestName(activeRequest)}`;
|
newTitle += ` – ${fallbackRequestName(activeRequest)}`;
|
||||||
}
|
}
|
||||||
appWindow.setTitle(newTitle).catch(console.error);
|
|
||||||
|
console.log('Skipping setting window title to ', newTitle);
|
||||||
|
// TODO: This resets the stoplight position so we can't use it yet
|
||||||
|
// appWindow.setTitle(newTitle).catch(console.error);
|
||||||
}, [activeEnvironment, activeRequest, activeWorkspace]);
|
}, [activeEnvironment, activeRequest, activeWorkspace]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user