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

Problem with wx.media.MediaCtrl on Debian #2332

Open
PhilippeDou opened this issue Jan 24, 2023 · 3 comments
Open

Problem with wx.media.MediaCtrl on Debian #2332

PhilippeDou opened this issue Jan 24, 2023 · 3 comments

Comments

@PhilippeDou
Copy link

PhilippeDou commented Jan 24, 2023

Operating system:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian

wxPython version & source:
'4.2.0 gtk3 (phoenix) wxWidgets 3.2.0'

Python version & source:
Python 3.9.10 (main, Jan 22 2023, 16:30:49)

Description of the problem:
I have probleme with wx.media.MediaCtrl which crash program when frame is showed with .show() function.
The error message displayed is :

X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Resource id in failed request: 0xda47c110
Serial number of failed request: 51
Current serial number in output stream: 54

Is-it possible to fix it ?
Philippe

Code Example (click to expand)
import wx
import wx.media
import os

class TestPanel(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, title='Media Player')
        #self.testMedia = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER, szBackend=wx.media.MEDIABACKEND_WMP10)
        self.testMedia = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER)
        self.chemin = os.path.dirname(os.path.abspath(__file__))
        self.media = self.chemin + '/Droite_1.mp4'

        self.testMedia.Bind(wx.media.EVT_MEDIA_LOADED, self.play)
        self.testMedia.Bind(wx.media.EVT_MEDIA_FINISHED, self.quit)
        self.Bind(wx.media.EVT_MEDIA_STOP, self.OnMediaStop, self.testMedia)
        self.Bind(wx.EVT_CLOSE, self.quit)
        if self.testMedia.Load(self.media):
            pass
        else:
            print("Media not found")
            self.quit(None)
        self.Show()

    def play(self, event):
        self.testMedia.Play()

    def quit(self, event):
        self.testMedia.Stop()
        self.Destroy()

    # Sets the mp4 file in a loop for testing only
    def OnMediaStop(self, event):
        self.testMedia.Seek(0)
        event.Veto()

if __name__ == '__main__':
    app = wx.App()
    Frame = TestPanel()
    app.MainLoop()
@swt2c
Copy link
Collaborator

swt2c commented Jan 24, 2023

Are you using X11 or Wayland?

@PhilippeDou
Copy link
Author

I'm on WSL debian on Windows 11

@RobinD42
Copy link
Member

RobinD42 commented Dec 4, 2023

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/ubuntu-linux-wxpython-mediactrl-fails-under-wayland/36746/2

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

3 participants