scorninpc / php-gtk3

GTK3 extension for PHP
https://andor.com.br/
GNU Lesser General Public License v3.0
118 stars 13 forks source link

Menubar touch malfunction #69

Closed apss-pohl closed 10 months ago

apss-pohl commented 1 year ago

Hi Bruno,

we stumbled upon an issue with touch again. Using a menubar with touch leaves the previous selected item open: image

I know you don't have a touch device but maybe you have an idea?

It can be reproduced with this code:

<?php

/**
 * 
 * MENUBAR POINT
 * 
 * 
 * 
 */
$submenu_datei = new GtkMenu();
$submenu_datei->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_datei->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_datei->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_datei->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_datei->append(GtkMenuItem::new_with_mnemonic('TEST1'));

$menu_datei = GtkMenuItem::new_with_mnemonic('_Datei111111111111111111');
$menu_datei->set_name('_Datei');
$menu_datei->set_submenu($submenu_datei);
/**
 * 
 * MENUBAR POINT
 * 
 * 
 * 
 */
$submenu_info = new GtkMenu();
$submenu_info->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_info->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_info->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_info->append(GtkMenuItem::new_with_mnemonic('TEST1'));
$submenu_info->append(GtkMenuItem::new_with_mnemonic('TEST1'));

$menu_info = GtkMenuItem::new_with_mnemonic('_INFO1111111111111111');
$menu_info->set_name('_INFO');
$menu_info->set_submenu($submenu_info);
/**
 * 
 * MENUBAR
 * 
 * 
 * 
 */
$menuleiste = new GtkMenuBar();
$menuleiste->append($menu_datei);
$menuleiste->append($menu_info);

$mainBox = new GtkBox(GtkOrientation::VERTICAL);
$mainBox->pack_start($menuleiste, false, false, 0);

$win = new GtkWindow(Gtk::WINDOW_TOPLEVEL);
$win->connect('destroy', array('gtk', 'main_quit'));
$win->set_default_size(800, 800);
$win->set_title("PHP-GTK3");
$win->set_position(Gtk::WIN_POS_CENTER);
$win->set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);
$win->add($mainBox);

// Show all
$win->show_all();

// Loop
Gtk::main();
scorninpc commented 1 year ago

hey Sven!

Yes! this is a big problem for me, because i read that Gtk3 has a lot feature about touches, so i cannot validate if this is a Gtk problem or PHP-GTK problem

I think your best try 'll try to configure touch as mouse click. this will invalidate multitouch, but will work as a mouse

this is a possible?

or try to test some methods, like https://docs.gtk.org/gtk3/property.Settings.gtk-touchscreen-mode.html

Did you add event to TOUCH_MASK ?

some references:

apss-pohl commented 1 year ago

We tryed with TOUCK_MASK already, but didn`t help. Touchscreen mode is deprecated as of 3.4 We should use those:

https://docs.gtk.org/gdk3/method.Event.get_source_device.html https://docs.gtk.org/gdk3/method.Event.set_source_device.html

Would you consider to implement them?

scorninpc commented 1 year ago

Would you consider to implement them?

you can try implement some test metod in Gtk class, something like Gtk::sven_set_touch()

and do this configs inside this method, to see if anything changes. if it's work, i think that is a good idea implement. what you think?

apss-pohl commented 1 year ago

What kind of configs do you consider? I am a little bit lost here

scorninpc commented 1 year ago

Maybe setting this as FALSE

scorninpc commented 11 months ago

hey Sven, how are you?

Are you guys using this project yet? how about this touch problem?

apss-pohl commented 10 months ago

Hey Bruno, happy new year :) we worked around this application wise, therefore we didn`t followup on this.