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

popup window dropshadow is black #2398

Closed
totaam opened this issue Aug 30, 2019 · 11 comments
Closed

popup window dropshadow is black #2398

totaam opened this issue Aug 30, 2019 · 11 comments
Labels

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 30, 2019

Issue migrated from trac ticket # 2398

component: client | priority: minor | resolution: fixed

2019-08-30 08:22:17: irony created the issue


server: xpra v2.5.3-r23270
[[BR]]

-client*: Xpra 2.5.3 32bit revision 23270
[[BR]]
[[BR]]

-1、Describe*
some application popup window has shadow, but it's show black.
like this app named wps: https://linux.wps.cn
[[BR]]

-2、Test Wps*
Use Xpra and Xmanager
[[BR]]

Xpra: [[Image(https://raw.githubusercontent.com/892768447/static/master/black2.png)]]
[[BR]]

Xmanager: [[Image(https://raw.githubusercontent.com/892768447/static/master/xmanager.png)]]
[[BR]]

-3、some qt code test*

testqt.py
[[BR]]


#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年4月19日
@author: Irony
"""

from PyQt4.QtCore import Qt, QSize, QTimer
from PyQt4.QtGui import QDialog, QVBoxLayout, QWidget,\
    QGraphicsDropShadowEffect, QPushButton, QGridLayout, QSpacerItem,\
    QSizePolicy


__Author__ = "Irony"
__Copyright__ = 'Copyright (c) 2019 Irony'
__Version__ = 1.0

Stylesheet = """
#Custom_Widget {
    background: white;
    border-radius: 10px;
}

#closeButton {
    min-width: 36px;
    min-height: 36px;
    font-family: "Webdings";
    qproperty-text: "r";
    border-radius: 10px;
}
#closeButton:hover {
    color: white;
    background: red;
}
"""


class Dialog(QDialog):

    def __init__(self, *args, **kwargs):
        super(Dialog, self).__init__(*args, **kwargs)
        self.setObjectName('Custom_Dialog')
        self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
        self.setAttribute(Qt.WA_TranslucentBackground, True)
        self.setStyleSheet(Stylesheet)
        self.initUi()
        # add shadow
        effect = QGraphicsDropShadowEffect(self)
        effect.setBlurRadius(12)
        effect.setOffset(0, 0)
        effect.setColor(Qt.gray)
        self.setGraphicsEffect(effect)

    def initUi(self):
        layout = QVBoxLayout(self)
        # background and border radius
        self.widget = QWidget(self)
        self.widget.setObjectName('Custom_Widget')
        layout.addWidget(self.widget)

        
        layout = QGridLayout(self.widget)
        layout.addItem(QSpacerItem(
            40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum), 0, 0)
        layout.addWidget(QPushButton(
            'r', self, clicked=self.accept, objectName='closeButton'), 0, 1)
        layout.addItem(QSpacerItem(20, 40, QSizePolicy.Minimum,
                                   QSizePolicy.Expanding), 1, 0)

    def sizeHint(self):
        return QSize(600, 400)


if __name__ == '__main__':
    import sys
    from PyQt4.QtGui import QApplication
    app = QApplication(sys.argv)
    w = Dialog()
    w.exec_()
    QTimer.singleShot(200, app.quit)
    sys.exit(app.exec_())

[[BR]]
Qt App: [[Image(https://raw.githubusercontent.com/892768447/static/master/black1.png)]]

@totaam
Copy link
Collaborator Author

totaam commented Aug 30, 2019

2019-08-30 08:59:55: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Aug 30, 2019

2019-08-30 08:59:55: antoine commented


Is this a windows client? Linux?
OpenGL enabled? Have you tried disabling it?

@totaam
Copy link
Collaborator Author

totaam commented Aug 30, 2019

2019-08-30 10:15:21: irony commented


Replying to [comment:1 Antoine Martin]:

Is this a windows client? Linux?
OpenGL enabled? Have you tried disabling it?

I test on windows client,default start client, I will try disable opengl then test

@totaam
Copy link
Collaborator Author

totaam commented Aug 31, 2019

2019-08-31 09:14:52: @totaam changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Aug 31, 2019

2019-08-31 09:14:52: @totaam changed owner from antoine to totaamwin32

@totaam
Copy link
Collaborator Author

totaam commented Aug 31, 2019

2019-08-31 09:14:52: @totaam commented


I can reproduce the problem with win32 clients only.
The client does print this warning:

Warning: window 2 changed its transparency attribute
 from False to True, behaviour is undefined

Transparency starts disabled on win32.

@totaam
Copy link
Collaborator Author

totaam commented Sep 1, 2019

2019-09-01 14:44:25: @totaam changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Sep 1, 2019

2019-09-01 14:44:25: @totaam set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Sep 1, 2019

2019-09-01 14:44:25: @totaam commented


The bug is actually only present with the mswindows clients and is due to the lack of support for transparent windows with the python2 builds (default in 2.5.x).
The fix for python3 clients is in r23666. See also #1682, #279

You can find beta mswindows builds with this fix here: [https://xpra.org/beta/windows/]

BTW, why are you using the 32-bit version? client: Xpra 2.5.3 32bit revision 23270

@totaam totaam closed this as completed Sep 1, 2019
@totaam
Copy link
Collaborator Author

totaam commented Sep 1, 2019

2019-09-01 15:32:18: irony commented


Replying to [comment:4 totaamwin32]:

The bug is actually only present with the mswindows clients and is due to the lack of support for transparent windows with the python2 builds (default in 2.5.x).
The fix for python3 clients is in r23666. See also #1682, #279

You can find beta mswindows builds with this fix here: [https://xpra.org/beta/windows/]

BTW, why are you using the 32-bit version? client: Xpra 2.5.3 32bit revision 23270

many times, 32-bit Compatibility is better, and if there are no more memory requirements, 32 bits are generally compiled and used. I think.

Thanks a lot!

@totaam
Copy link
Collaborator Author

totaam commented Sep 1, 2019

2019-09-01 20:30:35: antoine commented


many times, 32-bit Compatibility is better, and if there are no more memory requirements, 32 bits are generally compiled and used.
FYI: The 32-bit version of xpra for mswindows will no longer packaged after v3.
There are no compatibility issues that I am aware of with 64-bit builds, and 64-bit builds offer security features that just aren't available in 32-bit mode.
Then there is also the performance of the media codecs, which are heavily optimized for 64-bit assembly.

@totaam totaam added the v2.5.x label Jan 22, 2021
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

1 participant