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

Mac下有QOpenGLWidget情况下的程序拖动问题 #9

Open
retamia opened this issue Jan 10, 2018 · 3 comments
Open

Mac下有QOpenGLWidget情况下的程序拖动问题 #9

retamia opened this issue Jan 10, 2018 · 3 comments

Comments

@retamia
Copy link

retamia commented Jan 10, 2018

Mac下有QOpenGLWidget的情况下把程序拖到另一个屏幕程序会出现4分之三的黑屏
image

@retamia
Copy link
Author

retamia commented Jan 10, 2018

NSWindowStyleMaskFullSizeContentView 去掉这个style就不会出现这问题

@retamia
Copy link
Author

retamia commented Jan 10, 2018

@retamia
Copy link
Author

retamia commented Jan 10, 2018

解决这问题了。在窗口移动的事件里面加下面代码
`
void CFramelessWindow::moveEvent(QMoveEvent *event)
{

NSView *view = (NSView *)this->winId();

if (view.layer == nil)
    return QWidget::moveEvent(event);
QDesktopWidget *desktop = QApplication::desktop();
int curMonitor = desktop->screenNumber(this);
CGFloat ratio = (CGFloat)QApplication::desktop()->screen(curMonitor)->devicePixelRatio();
[view.layer setContentsScale: ratio];

}
`

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

No branches or pull requests

1 participant