Skip to content

Commit 80d399d

Browse files
committed
touchy: GTK3 no longer provides a way to send client messages - comment out
This was used to indicate to embedded tabs that they were active, particularly useful where the tab could use hardware buttons to cause effects. In the future this might be brought back with straight X11 messaging. In the interim the one tab set that used this (lathe macros) will try to determine state from internal parameters Signed-off-by: andypugh <andy@bodgesoc.org>
1 parent 979139a commit 80d399d

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

src/emc/usr_intf/touchy/touchy.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -400,30 +400,31 @@ def __init__(self, inifile):
400400
def quit(self, unused):
401401
Gtk.main_quit()
402402

403-
def send_message(self,socket,dest_xid,message):
404-
event = Gdk.Event(Gdk.CLIENT_EVENT)
405-
event.window = socket.get_window() # needs sending Gdk window
406-
event.message_type = Gdk.atom_intern('Gladevcp') # change to any text you like
407-
event.data_format = 8 # 8 bit (char) data (options: long,short)
408-
event.data = message # must be exactly 20 char bytes (options: 5 long or 10 short)
409-
event.send_event = True # signals this was sent explicedly
410-
event.send_client_message(dest_xid) # uses destination XID window number
403+
# This does not work in GTK3 - https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/usr_intf/touchy/touchy.py#L403
404+
405+
# def send_message(self,socket,dest_xid,message):
406+
# event = Gdk.Event(Gdk.CLIENT_EVENT)
407+
# event.window = socket.get_window() # needs sending Gdk window
408+
# event.message_type = Gdk.atom_intern('Gladevcp') # change to any text you like
409+
# event.data_format = 8 # 8 bit (char) data (options: long,short)
410+
# event.data = message # must be exactly 20 char bytes (options: 5 long or 10 short)
411+
# event.send_event = True # signals this was sent explicedly
412+
# event.send_client_message(dest_xid) # uses destination XID window number
411413

412414

413415
def tabselect(self, notebook, b, tab):
414-
new_tab=notebook.get_nth_page(tab)
415-
old_tab=notebook.get_nth_page(self.tab)
416+
# new_tab=notebook.get_nth_page(tab)
417+
# old_tab=notebook.get_nth_page(self.tab)
416418
self.tab = tab
417-
for c in self._dynamic_childs:
418-
if new_tab.__gtype__.name =='GtkSocket':
419-
w= new_tab.get_plug_window()
420-
if new_tab.get_id()==c:
421-
self.send_message(new_tab,w.xid,"Visible\0\0\0\0\0\0\0\0\0\0\0\0\0")
422-
423-
if old_tab.__gtype__.name =='GtkSocket':
424-
w= old_tab.get_plug_window()
425-
if old_tab.get_id()==c:
426-
self.send_message(old_tab,w.xid,"Hidden\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
419+
# for c in self._dynamic_childs:
420+
# if new_tab.__gtype__.name =='GtkSocket':
421+
# w= new_tab.get_plug_window()
422+
# if new_tab.get_id()==c:
423+
# self.send_message(new_tab,w.xid,"Visible\0\0\0\0\0\0\0\0\0\0\0\0\0")
424+
# if old_tab.__gtype__.name =='GtkSocket':
425+
# w= old_tab.get_plug_window()
426+
# if old_tab.get_id()==c:
427+
# self.send_message(old_tab,w.xid,"Hidden\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
427428

428429
def pointer_hide(self, b = None):
429430
if self.radiobutton_mask: return

0 commit comments

Comments
 (0)