Kirottu / watershot

A simple wayland native screenshot tool.
GNU General Public License v3.0
171 stars 15 forks source link

Multiple monitors #11

Open jennydaman opened 1 year ago

jennydaman commented 1 year ago

I have a dual-monitor setup: a left (270⁰) vertical monitor, scaled by 1.5x, and a right horizontal monitor.

picture of desktop

The watershot preview is magnified and centered, with a black bar on the left desktop. I am unable to effectively select a region to screenshot.

picture of watershot preview

Kirottu commented 1 year ago

Right, monitor scale is not something I accounted for. I'll get it fixed when I have time

Kirottu commented 1 year ago

Hi again, sorry for the long time but with the latest changes on the master branch HiDPI should work. Would you mind testing it out with your display configuration?

jennydaman commented 1 year ago

Trying to build 54f3bb7d2a5052b698402be3a7c6a232db28bf26 gave me errors:

error[E0432]: unresolved import `wgpu_text::section`
 --> src/rendering.rs:4:16
  |
4 | use wgpu_text::section::{HorizontalAlign, Layout, OwnedSection, OwnedText, VerticalAlign};
  |                ^^^^^^^ could not find `section` in `wgpu_text`

error[E0433]: failed to resolve: could not find `font` in `wgpu_text`
  --> src/runtime_data.rs:50:26
   |
50 |     pub font: wgpu_text::font::FontArc,
   |                          ^^^^ could not find `font` in `wgpu_text`

error[E0433]: failed to resolve: could not find `font` in `wgpu_text`
   --> src/runtime_data.rs:139:30
    |
139 |             font: wgpu_text::font::FontArc::try_from_vec(
    |                              ^^^^ could not find `font` in `wgpu_text`

error[E0433]: failed to resolve: could not find `section` in `wgpu_text`
   --> src/types.rs:111:33
    |
111 | impl From<Color> for wgpu_text::section::Color {
    |                                 ^^^^^^^ could not find `section` in `wgpu_text`

error[E0433]: failed to resolve: could not find `font` in `wgpu_text`
  --> src/rendering.rs:64:48
   |
64 |     pub brush: wgpu_text::TextBrush<wgpu_text::font::FontArc>,
   |                                                ^^^^ could not find `font` in `wgpu_text`

This happens because when I run cargo install --path ., cargo resolves wgpu_text as version 0.8.2 instead of version 0.8.1.

I tried cargo build --release and then run target/release/watershot, which panicked:

warning: queue 0x5560ce3554e0 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@5 still attached
  zwp_linux_dmabuf_v1@6 still attached
[ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Vulkan)>`
    In a set_pipeline command
      note: render pipeline = `<RenderPipeline-(0, 1, Vulkan)>`
    Render pipeline targets are incompatible with render pass
    Incompatible color attachments at indices [0]: the RenderPass uses textures with formats [Some(Bgra8Unorm)] but the RenderPipeline uses attachments with formats [Some(Bgra8UnormSrgb)]

', /home/jenni/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.16.1/src/backend/direct.rs:3019:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x5560cec9de00 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@31 still attached
  zwp_linux_dmabuf_v1@32 still attached
warning: queue 0x5560ce994870 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@20 still attached
  zwp_linux_dmabuf_v1@21 still attached
Kirottu commented 1 year ago

Alright, can you try the current master branch? It could be that my naive way of handling texture formats is inadequate.

jennydaman commented 1 year ago

Sorry, I’m traveling right now and don’t have access to my computer. I’ll give it a shot when I get back!