Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Cannot create small window (with approximately 100 width or less) #6792

Closed
cpfy opened this issue Apr 25, 2023 · 6 comments
Closed

[bug] Cannot create small window (with approximately 100 width or less) #6792

cpfy opened this issue Apr 25, 2023 · 6 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@cpfy
Copy link

cpfy commented Apr 25, 2023

Describe the bug

When I specified a smaller window size, the window size generated by tauri was not as expected due to windows native titlebar.

Reproduction

with following settings in tauri.conf.json

"windows": [
      {
        "label": "xxx",
        "width": 20,
        "height": 20,
        "alwaysOnTop": true
      }
]

Then I get:

image

You can see that the width is much larger than the value I set (20).

Expected behavior

windows size matches my settings.

Platform and versions

› OS: Windows 10.0.19044 X64
  › Webview2: 112.0.1722.58
  › MSVC:
  › Node.js: 16.13.0
  › npm: 8.1.3
  › pnpm: 8.3.1
  › rustup: 1.25.2
  › rustc: 1.69.0
  › cargo: 1.69.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Stack trace

No response

Additional context

No response

@cpfy cpfy added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 25, 2023
@amrbashir
Copy link
Member

You can disable the decorations using https://tauri.app/v1/api/config#windowconfig.decorations, otherwise you are stuck with the native title bar which has a fixed size.

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2023
@cpfy
Copy link
Author

cpfy commented Apr 26, 2023

Actually, I had set "decorations": false, but the problem still exists, the width of the window is always larger than the value I set. The problem is only solved when the window is larger than a certain value (e.g. 150x150)

window size 20x20

"decorations": true
image

"decorations": false
image

window size 150x150

"decorations": true
image

"decorations": false
image

I guess the decorations setting just hides the borders and bars, but in fact the conflict with native title bar is still there, just as it was when the decorations were displayed

@amrbashir amrbashir reopened this Apr 26, 2023
@amrbashir
Copy link
Member

amrbashir commented Apr 26, 2023

@cpfy

Could you tell me what is your use-case, just want to see if you can use the current API?

I found a way to allow smaller window size but it has limitations unfortunately with transparency like this weird border appearing when alt+tabbing into the window

image

This weird border exists when first creating a 2px window which will apear like this
image

and sometimes you'd get something like this
image

@cpfy
Copy link
Author

cpfy commented Apr 28, 2023

@amrbashir

Sorry for the late reply~

I would like to create a floating bubble on the desktop. It can be dragged, clicked to interact, and display specified content. This requirement is more like what was mentioned in issues #4360, #6125. But I have been unable to set the window to a suitable size.

Would you have any suggestions on how to implement this feature? Thank you!

(p.s. the bubble would look like this:

@amrbashir
Copy link
Member

for your use-case (as shown in your screenshot), I think our minimum size on Windows with decorations: false is good enough, as for Linux and #6125, this is a bug with resizable option on Linux (especially Gnome Desktop Environment), see tauri-apps/tao#561

@Neo110
Copy link

Neo110 commented Jul 17, 2023

i get it ,use winit .
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants