diff -Nru glade2script-3.2.4~ppa21/debian/changelog glade2script-3.2.4~ppa22/debian/changelog --- glade2script-3.2.4~ppa21/debian/changelog 2020-03-15 13:14:14.000000000 +0000 +++ glade2script-3.2.4~ppa22/debian/changelog 2020-03-15 13:14:14.000000000 +0000 @@ -1,4 +1,4 @@ -glade2script (3.2.4~ppa21) bionic; urgency=low +glade2script (3.2.4~ppa22) bionic; urgency=low * Sources creation diff -Nru glade2script-3.2.4~ppa21/usr/bin/glade2script-python3 glade2script-3.2.4~ppa22/usr/bin/glade2script-python3 --- glade2script-3.2.4~ppa21/usr/bin/glade2script-python3 2020-03-15 13:14:14.000000000 +0000 +++ glade2script-3.2.4~ppa22/usr/bin/glade2script-python3 2020-03-15 13:14:14.000000000 +0000 @@ -131,7 +131,7 @@ def set_gobject_idle_add(self, widget, action, value): widget = getattr(self.gui, widget) method = getattr(widget, action) - GObject.idle_add(method, *value) + GLib.idle_add(method, *value) def set_bool_int_widgets(self, section, gettype, gtkfunction): for option in self.options(section): @@ -953,7 +953,7 @@ size = height pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filename, width, height) - GObject.idle_add(widget.set_from_pixbuf, pixbuf) + GLib.idle_add(widget.set_from_pixbuf, pixbuf) DEBUG('[[ SCALE IMG ]] %s %s %s'% (width, height, filename)) @@ -1346,11 +1346,11 @@ window.connect('realize', self.window_realize_cb) if gtkrc is not None: self.apply_gtkrc( window, gtkrc ) - screen = window.get_screen() - self.screen_width, self.screen_height = (screen.get_width(), - screen.get_height()) - DIC_ENV['G2S_SCREEN_HEIGHT'] = str(self.screen_height, encoding='utf-8', errors='strict') - DIC_ENV['G2S_SCREEN_WIDTH'] = str(self.screen_width, encoding='utf-8', errors='strict') + display = Gdk.Display.get_default() + monitor = display.get_monitor_at_window(display, window) + self.monitor_width, self.monitor_height = monitor.get_geometry() + DIC_ENV['G2S_MONITOR_HEIGHT'] = str(self.monitor_height, encoding='utf-8', errors='strict') + DIC_ENV['G2S_MONITOR_WIDTH'] = str(self.monitor_width, encoding='utf-8', errors='strict') def window_realize_cb(self, window): self.window_realized = True @@ -1972,15 +1972,16 @@ widget = eval('self.%s' % widget_name) #widget.connect('draw', self.expose) #widget.connect('configure-event', self.expose) - widget.set_visual( self.get_screen_colormap(widget) ) + widget.set_visual( self.get_monitor_colormap(widget) ) widget.set_app_paintable(True) #widget.realize() - def get_screen_colormap(self, window): - screen = window.get_screen() - colormap = screen.get_rgba_visual() + def get_monitor_colormap(self, window): + display = Gdk.Display.get_default() + monitor = display.get_monitor_at_window(display, window) + colormap = monitor.get_rgba_visual() if colormap == None: - colormap = screen.get_system_visual() + colormap = monitor.get_system_visual() return colormap def expose(self, window, cr): @@ -2156,7 +2157,7 @@ if type(Gpere ) == Gtk.Viewport: container_width = width * widget.get_column_count() container_height = height * widget.get_row_count() - GObject.idle_add(Gpere.set_size_request, container_width, + GLib.idle_add(Gpere.set_size_request, container_width, container_height) self.flag_term = True @@ -2181,9 +2182,9 @@ self.line_size = self.terminal.get_char_height() nb_col = self.defaut_width / self.col_size nb_line = self.defaut_hight / self.line_size - GObject.idle_add(self.terminal.set_size, nb_col, nb_line) + GLib.idle_add(self.terminal.set_size, nb_col, nb_line) self.old_nb_col, self.old_nb_row = nb_col, nb_line - GObject.idle_add(widget.set_size_request, self.defaut_width, self.defaut_hight) + GLib.idle_add(widget.set_size_request, self.defaut_width, self.defaut_hight) return x, y, w, h = (rect.x, rect.y, rect.width, rect.height) #x, y, w, h = list(rect) @@ -2193,7 +2194,7 @@ if new_w != self.old_nb_col or new_h != self.old_nb_row: if self.flag_event: self.flag_event = False # flag to avoid the first signal else: - GObject.idle_add(self.terminal.set_size, new_w, new_h ) + GLib.idle_add(self.terminal.set_size, new_w, new_h ) self.old_nb_col, self.old_nb_row = new_w, new_h ''' @@ -2272,11 +2273,12 @@ # 3, time, widget) def apply_gtkrc(self, widget, gtkrc): - screen = Gdk.Screen.get_default() + display = Gdk.Display.get_default() + monitor = display.get_monitor() provider = Gtk.CssProvider() provider.load_from_path(gtkrc) context = Gtk.StyleContext() - context.add_provider_for_screen(screen, provider, + context.add_provider_for_monitor(monitor, provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) return #~FIXME can't do it for single widget/window @@ -2351,7 +2353,7 @@ item = None combo, modele = self.return_tree_store(name) nb = len(modele) - GObject.idle_add(getattr(self, cmd), nb, combo, modele, item) + GLib.idle_add(getattr(self, cmd), nb, combo, modele, item) def COMBOIMG(self, nb, combo, modele, item): ''' @@ -2444,7 +2446,7 @@ ''' def TREE(self, sortie, arg=False): cmd='TREE%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def TREEINSERT(self, sortie): ''' @@ -2535,7 +2537,7 @@ modele.append(None, liste_data) num_row = len(list(modele))-1 if num_row > 0: - gobject.idle_add(treeview.scroll_to_cell, num_row) + GLib.idle_add(treeview.scroll_to_cell, num_row) def TREEEND(self, sortie): ''' @@ -2551,7 +2553,7 @@ modele.append(None, liste ) num_row = len(list(modele))-1 if num_row > 0: - gobject.idle_add(treeview.scroll_to_cell, num_row) + GLib.idle_add(treeview.scroll_to_cell, num_row) def TREEUP(self, sortie): ''' @@ -2793,7 +2795,7 @@ treeview, modele = self.return_tree_store(name) iter = modele.get_iter_from_string(row) path = modele.get_path(iter) - GObject.idle_add(treeview.set_cursor, path, None, False) + GLib.idle_add(treeview.set_cursor, path, None, False) def return_tree_store(self, name): treeview = eval('self.gui.%s' % (name) ) @@ -2917,7 +2919,7 @@ ''' def TEXT(self, sortie, arg=False): cmd = 'TEXT%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def TEXTAUTOUR(self, sortie, tag=False): ''' @@ -3356,7 +3358,7 @@ class CmdWEBKIT(object): def WEBKIT(self, sortie, arg=False): cmd = 'WEBKIT%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def WEBKITSAVE(self, sortie, arg=False): ''' @@ -3624,7 +3626,7 @@ def CLIP(self, sortie, arg=False): self.current_clipboard_text = None cmd = 'CLIP%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie, arg) + GLib.idle_add(getattr(self, cmd), sortie, arg) if import_py is not None: if arg: self.IMPORT.clipboard(self.current_clipboard_text) @@ -3679,7 +3681,7 @@ widget, action, etat, color = sortie.split('@@')[1:] for wid in widget.replace(' ', '').split(','): widget_action = '%s.override_%s' % (wid, action) - GObject.idle_add(self.gui.set_color, widget_action, + GLib.idle_add(self.gui.set_color, widget_action, 'Gtk.StateFlags.%s'%etat, color) ''' @@ -3687,7 +3689,7 @@ ''' def CONFIG(self, sortie, arg=False): cmd = 'CONFIG%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def CONFIGSAVE(self, sortie): ''' @@ -3746,7 +3748,7 @@ def FILE(self, sortie, arg=False): cmd = 'FILE%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def FILESETFILTER(self, sortie, arg=False): ''' @@ -3769,7 +3771,7 @@ ''' def GEO(self, sortie, arg=False): cmd='GEO%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def GEOGET(self, sortie, arg=False): ''' @@ -3842,14 +3844,15 @@ @info stylefile: relative or absolute path of the gtk-style file ''' gtkrc = sortie.split('@@')[1] - screen = Gdk.Screen.get_default() + display = Gdk.Display.get_default() + monitor = display.get_monitor() provider = Gtk.CssProvider() if os.path.isfile(gtkrc): provider.load_from_path(gtkrc) else: provider.load_from_data(gtkrc) context = Gtk.StyleContext() - GObject.idle_add(context.add_provider_for_screen, screen, provider, + GLib.idle_add(context.add_provider_for_monitor, monitor, provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) return widget, rcfile = sortie.split('@@')[1:] @@ -3873,7 +3876,7 @@ pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( path, int(x), int(y) ) self.gui.dic_img[widget] = path img = eval('self.gui.%s' % (widget) ) - GObject.idle_add(img.set_from_pixbuf, pixbuf) + GLib.idle_add(img.set_from_pixbuf, pixbuf) ''' *** GET THE STATUS OF CHILD TOOGLE WIDGET @@ -4087,7 +4090,7 @@ def PLUGIN(self, sortie, arg=False): cmd = 'PLUGIN%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def PLUGININIT(self, sortie): ''' @@ -4117,7 +4120,7 @@ def POINTER(self, sortie, arg=False): cmd = 'POINTER%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def POINTERSTART(self, sortie): ''' @@ -4130,7 +4133,7 @@ ''' delay, name = sortie.split('@@')[2:] widget = eval( 'self.gui.%s' % name ) - rootwin = widget.get_screen().get_root_window() + rootwin = widget.get_monitor().get_root_window() #yann: probably needs to be fixed win, x, y, mask = rootwin.get_pointer() #self.flag_move = True self.old_x_move = x @@ -4149,7 +4152,7 @@ self.flag_move = False def check_pointer(self, widget, name): - rootwin = widget.get_screen().get_root_window() + rootwin = widget.get_monitor().get_root_window() #yann: probably needs to be fixed win, x, y, mods = rootwin.get_pointer() if x != self.old_x_move or y != self.old_y_move: self.old_x_move = x @@ -4161,23 +4164,23 @@ return eval('self.flag_move_%s' % name) ''' - *** SCREEN DIMENSION + *** MONITOR DIMENSION ''' - def SCREEN(self, sortie, arg=False): + def MONITOR(self, sortie, arg=False): ''' - @name SCREEN@@ - @brief Loads the screen dimensions in the environment + @name MONITOR@@ + @brief Loads the monitor dimensions in the environment @info keep for retro-compatibility since < 2.3.0 - @info otherwise G2S_SCREEN_HEIGHT, G2S_SCREEN_WIDTH variables was loaded - @return screen_height="1200" screen_width="1800" + @info otherwise G2S_MONITOR_HEIGHT, G2S_MONITOR_WIDTH variables was loaded + @return monitor_height="1200" monitor_width="1800" @return py: (width, height) ''' if import_py is not None: - setattr(self.IMPORT, 'screen_width', self.gui.screen_width) - setattr(self.IMPORT, 'screen_height', self.gui.screen_height) - return (self.gui.screen_width, self.gui.screen_height) - self.send('GET@screen_height="%s"' % self.gui.screen_height) - self.send('GET@screen_width="%s"' % self.gui.screen_width) + setattr(self.IMPORT, 'monitor_width', self.gui.monitor_width) + setattr(self.IMPORT, 'monitor_height', self.gui.monitor_height) + return (self.gui.monitor_width, self.gui.monitor_height) + self.send('GET@monitor_height="%s"' % self.gui.monitor_height) + self.send('GET@monitor_width="%s"' % self.gui.monitor_width) ''' *** PYGTK @@ -4189,7 +4192,7 @@ @brief runs a pygtk command (show(), hide(), ...) ''' sortie = sortie.replace('SET@', '') - GObject.idle_add(self.gui.set_widget, sortie ) + GLib.idle_add(self.gui.set_widget, sortie ) ''' *** STATUSBAR @@ -4203,7 +4206,7 @@ widget, text = sortie.split('@@')[1:] statusbar = getattr(self.gui, widget) context = getattr(self.gui, 'context_%s'%widget) - GObject.idle_add(statusbar.push, context, text) + GLib.idle_add(statusbar.push, context, text) ''' *** SYSTRAY @@ -4220,14 +4223,14 @@ @info Default hide, use pygtk command to show it and more (see exemple) ''' l = sortie.split('@@')[1:] - GObject.idle_add(self.gui.new_systray_icon, *l) + GLib.idle_add(self.gui.new_systray_icon, *l) ''' *** TOGGLE ''' def TOGGLE(self, sortie, arg=False): cmd = 'TOGGLE%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def TOGGLESENSITIVE(self, sortie): ''' @@ -4281,7 +4284,7 @@ ''' def TERM(self, sortie, arg=False): cmd='TERM%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def TERMFONT(self, sortie): ''' @@ -4329,7 +4332,7 @@ def TIMER(self, sortie, arg=False): cmd='TIMER%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def TIMERSTART(self, sortie): ''' @@ -4360,7 +4363,7 @@ def WINDOW(self, sortie, arg=False): cmd = 'WINDOW%s' % sortie.split('@@')[1] - GObject.idle_add(getattr(self, cmd), sortie) + GLib.idle_add(getattr(self, cmd), sortie) def WINDOWBACKGROUND(self, sortie): ''' @@ -4643,8 +4646,8 @@ l_weboverlink = [] systray_icon = [] DIC_ENV = { - 'G2S_SCREEN_WIDTH': '0', - 'G2S_SCREEN_HEIGHT': '0', + 'G2S_MONITOR_WIDTH': '0', + 'G2S_MONITOR_HEIGHT': '0', 'G2S_TERMINAL_PID': '0', 'G2S_SOURCEVIEW_LANG': 'None', 'G2S_SOURCEVIEW_STYLE': 'None',