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

white space appear at left and bottom of window after minimize and restore. #589

Closed
plasticanne opened this issue Aug 14, 2020 · 10 comments
Closed
Labels

Comments

@plasticanne
Copy link

Specification

  • pywebview version: 3.3.3
  • platform / version: win10
  • cefpython3 version 66.0

Description

With set frameless=True or fullscreen=True.
Once window.minimize() and then restore window by click windows taskbar, a white space appear at left and bottom of window about 16px and 38px.
I believe this problem is related to the fix of #484 .

@plasticanne
Copy link
Author

At webview.platforms.cef.Browser

def resize(self, width, height):
webview.platforms.cef.windll.user32.SetWindowPos(self.inner_hwnd, 0, 0, 0, width - 16, height - 38,
0x0002 | 0x0004 | 0x0010)
self.browser.NotifyMoveOrResizeStarted()

remove - 16, - 38 will fix this issue, but at the same time, non-fullscreen window's scroll bar will disappear.

@r0x0r
Copy link
Owner

r0x0r commented Aug 27, 2020

Cannot reproduce it with this example

import webview
from time import sleep

def minimize(window):
    sleep(5)
    print('Minimizing window')
    window.minimize()


if __name__ == '__main__':
    window = webview.create_window('Minimize window example', html='<body style="background:red;"><h1>Minimize window</h1></body>', minimized=False)
    webview.start(minimize, window)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 27, 2020
@github-actions
Copy link

github-actions bot commented Oct 2, 2020

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.

@github-actions github-actions bot closed this as completed Oct 2, 2020
@oddmario
Copy link

oddmario commented Jul 8, 2021

I have the same issue.

@oddmario
Copy link

oddmario commented Jul 8, 2021

Cannot reproduce it with this example

import webview
from time import sleep

def minimize(window):
    sleep(5)
    print('Minimizing window')
    window.minimize()


if __name__ == '__main__':
    window = webview.create_window('Minimize window example', html='<body style="background:red;"><h1>Minimize window</h1></body>', minimized=False)
    webview.start(minimize, window)

@r0x0r You couldn't reproduce the issue because you didn't specify cef as the engine.

@oddmario
Copy link

oddmario commented Jul 8, 2021

At webview.platforms.cef.Browser

def resize(self, width, height):
webview.platforms.cef.windll.user32.SetWindowPos(self.inner_hwnd, 0, 0, 0, width - 16, height - 38,
0x0002 | 0x0004 | 0x0010)
self.browser.NotifyMoveOrResizeStarted()

remove - 16, - 38 will fix this issue, but at the same time, non-fullscreen window's scroll bar will disappear.

This fixed it and no I don't get any issues with the scroll bars. I'm not sure why such hardcoded values were put. Should I submit a PR for this?

@r0x0r
Copy link
Owner

r0x0r commented Jul 8, 2021

@oddmario I specify cef renderer via an environment variable in my tests.

Those hard-coded values were put to compensate for titlebar and scrollbars as we derive the dimensions of the cef component from the dimensions of the parent window. Hard-coded values do not seem to do the trick in all cases, so a better solution needed.
If you remove these values it will crop cef view contents.

@r0x0r r0x0r reopened this Jul 8, 2021
@github-actions github-actions bot removed the stale label Jul 9, 2021
@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 9, 2021
@github-actions
Copy link

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants