Skip to content

Windows display scale sometimes causes issues #1211

@Caaz

Description

@Caaz

Is there an existing issue for this?

  • I have searched the existing issues

Behavior

Current Behavior

I have a triple monitor set up in which my center monitor was a different resolution than the others, which by default in windows settings had a 125% scaling. I noticed that some apps (in my case PICO-8) would scale awkwardly when placed in a position near the right or lower edge of the screen would extend past the monitor's bounds into other monitors.

What's interesting is this doesn't happen for all windows, so I assume there's something strange going on regarding whatever controls window size for certain applications, but I'll admit I'm not exactly familiar with this type of thing.

Workaround

After switching to 100% scaling, this issue goes away.

Expected Behavior

All windows scale according to display scale.

C# Config

// the default
#nullable enable
#r "WHIM_PATH\whim.dll"
#r "WHIM_PATH\plugins\Whim.Bar\Whim.Bar.dll"
#r "WHIM_PATH\plugins\Whim.CommandPalette\Whim.CommandPalette.dll"
#r "WHIM_PATH\plugins\Whim.FloatingWindow\Whim.FloatingWindow.dll"
#r "WHIM_PATH\plugins\Whim.FocusIndicator\Whim.FocusIndicator.dll"
#r "WHIM_PATH\plugins\Whim.Gaps\Whim.Gaps.dll"
#r "WHIM_PATH\plugins\Whim.LayoutPreview\Whim.LayoutPreview.dll"
#r "WHIM_PATH\plugins\Whim.SliceLayout\Whim.SliceLayout.dll"
#r "WHIM_PATH\plugins\Whim.TreeLayout\Whim.TreeLayout.dll"
#r "WHIM_PATH\plugins\Whim.TreeLayout.Bar\Whim.TreeLayout.Bar.dll"
#r "WHIM_PATH\plugins\Whim.TreeLayout.CommandPalette\Whim.TreeLayout.CommandPalette.dll"
#r "WHIM_PATH\plugins\Whim.Updater\Whim.Updater.dll"
#r "WHIM_PATH\plugins\Whim.Yaml\Whim.Yaml.dll"

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.UI;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Whim;
using Whim.Bar;
using Whim.CommandPalette;
using Whim.FloatingWindow;
using Whim.FocusIndicator;
using Whim.Gaps;
using Whim.LayoutPreview;
using Whim.SliceLayout;
using Whim.TreeLayout;
using Whim.TreeLayout.Bar;
using Whim.TreeLayout.CommandPalette;
using Whim.Updater;
using Whim.Yaml;
using Windows.Win32.UI.Input.KeyboardAndMouse;

/// <summary>
/// This is what's called when Whim is loaded.
/// </summary>
/// <param name="context"></param>
void DoConfig(IContext context)
{
	context.Logger.Config = new LoggerConfig();

	// YAML config. It's best to load this first so that you can use it in your C# config.
	YamlLoader.Load(context);

	// Customize your config in C# here.
	// For more, see https://dalyisaac.github.io/Whim/script/scripting.html
	// ...
}

// We return doConfig here so that Whim can call it when it loads.
return DoConfig;

YAML Config

# also the default
# yaml-language-server: $schema=WHIM_PATH\plugins\Whim.Yaml\schema.json
workspaces:
  entries:
    - name: Workspace 1
    - name: Workspace 2
    - name: Workspace 3
    - name: Workspace 4

layout_engines:
  entries:
    - type: tree
      initial_direction: right

    - type: slice
      variant:
        type: row

    - type: slice
      variant:
        type: column

    - type: slice
      variant:
        type: primary_stack

    - type: slice
      variant:
        type: secondary_primary_stack

    - type: slice
      variant:
        type: multi_column_stack
        columns: [2, 1, 0]

    - type: slice
      variant:
        type: secondary_primary_stack
        primary_capacity: 1
        secondary_capacity: 2

    - type: focus
      maximize: false

    - type: floating

keybinds:
  entries:
    - command: whim.core.focus_next_monitor
      keybind: LCtrl+LShift+LAlt+K

    - command: whim.core.focus_previous_monitor
      keybind: LCtrl+LShift+LAlt+J

  unify_key_modifiers: true

filters:
  entries: []

routers:
  routing_behavior: route_to_launched_workspace

plugins:
  bar:
    left_components:
      entries:
        - type: workspace_widget

    center_components:
      entries:
        - type: focused_window_widget
          shorten_title: true

    right_components:
      entries:
        - type: battery_widget
        - type: active_layout_widget
        - type: date_time_widget
          format: HH:mm:ss, dd MMM yyyy
        - type: tree_layout_widget

  floating_window:
    is_enabled: true

  gaps:
    is_enabled: true
    outer_gap: 10
    inner_gap: 10
    default_outer_delta: 2
    default_inner_delta: 2

  command_palette:
    is_enabled: true
    max_height_percent: 40
    max_width_pixels: 800
    y_position_percent: 20

  focus_indicator:
    is_enabled: true
    border_size: 2
    is_fade_enabled: true
    fade_timeout: 2
    color: red

  layout_preview:
    is_enabled: true

  updater:
    is_enabled: true
    release_channel: alpha
    update_frequency: monthly

Environment

  • Windows: Version 10.0.26200 Build 26200
  • Architecture: x86_64
  • Whim: v0.8.6-alpha+37e06e85

Steps To Reproduce

  1. Install Whim as nrmal
  2. Set display scaling to 125%
  3. Place PICO-8 (I assume other applications apply here, I haven't tested extensively) near the right or lower edge
  4. See window bounds are larger than expected

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageUntriaged issues

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions