Skip to content

Commit

Permalink
Update MagicEye.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Toulouse committed Aug 8, 2022
1 parent 4005aeb commit 6de143d
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions MagicEye.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,25 @@
gi.require_version('Gdk', '3.0')
from gi.repository import Gst, GLib, GObject,Gtk,Gio,GdkPixbuf
from gi.repository import Gdk, GstVideo
Gdk.set_allowed_backends("x11")


#Gdk.set_allowed_backends("x11")
Gst.init(None)


Gst.init(None)
Gtk.init(None)
#print (Gdk.get_display() )
class UI(Gtk.Window):

os.system['Gdk_BACKEND'] = 'x11'

Gdk.set_allowed_backends("x11")



# print(Gdk.wayland_onscreen_get_surface())

def __init__(self):

#Gdk.set_allowed_backends("x11")
#icon = Gio.ThemedIcon(name="magiceye-02")
#self.set_icon(icon)
#icon = GdkPixbuf.Pixbuf.new_from_resource("magiceye-02.svg")
#print(icon)
#self.set_icon(icon)
tPackage = threading.Thread(target=self.package_check)
tPackage.start()
Gdk.set_allowed_backends("x11")
Gdk.set_allowed_backends("wayland,x11")
config = configparser.ConfigParser()
config.read(Config.full_config_file_path)
print(Config.full_config_file_path)
Expand All @@ -48,7 +45,7 @@ def __init__(self):
grid = Gtk.Grid(row_spacing =10,column_spacing = 10,column_homogeneous = True)

self.set_border_width(10)
#print(Gdk.get_display())
print(Gdk.get_display())
clientBtn = Gtk.Button(label="client")
clientBtn.connect("clicked",self.loadClient)

Expand Down Expand Up @@ -100,7 +97,8 @@ def onLoadDialogAbout(self,window):


def loadClient(self, window):
#print( os.environ )

os.environ['GDK_BACKEND'] = 'x11'
client.main()
# Gtk.Window.new(Player)
#Gtk.WindowType(0)
Expand All @@ -111,11 +109,7 @@ def loadClient(self, window):
#subprocess.Popen(file, shell=shellBool)

def loadServer(self, window):
#print( os.environ )
Gdk.set_allowed_backends("x11")
#os.environ['GDK_BACKEND']="x11"

##rint( os.environ )
os.environ['GDK_BACKEND'] = 'x11'
server.main()
server.ServerGui.__init__
# file=os.path.dirname(os.path.abspath(__file__))+"/server.py"
Expand Down Expand Up @@ -226,12 +220,6 @@ def package_check(self):

def main():
win = UI()
# if Gdk.get_display() == "wayland-0" :
# print("go here")
# os.environ['GDK_BACKEND']='x11'
# print(os.environ)
# #Gdk.Display.open(":1")
# #os.system="GDK_BACKEND=x11"+str(UI())
icon_app_path ='/home/thomas/.local/share/icons/MagicEye-icon/magiceye-06.svg'
pixbuf = GdkPixbuf.Pixbuf.new_from_file(icon_app_path)
win.set_icon(pixbuf)
Expand Down

0 comments on commit 6de143d

Please sign in to comment.