* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
GtkPackDirection pack_dir;
GtkPackDirection child_pack_dir;
gint min_height, nat_height;
- gint avail_size;
+ gint avail_size = 0;
min_height = nat_height = 0;
parent = gtk_widget_get_parent (widget);
gtk_style_context_save (context);
- gtk_style_context_set_state (context, state);
gtk_style_context_get_padding (context, state, &padding);
gtk_real_menu_item_select (GtkMenuItem *menu_item)
{
GtkMenuItemPrivate *priv = menu_item->priv;
- gboolean touchscreen_mode;
+ GdkDevice *source_device = NULL;
+ GdkEvent *current_event;
- g_object_get (gtk_widget_get_settings (GTK_WIDGET (menu_item)),
- "gtk-touchscreen-mode", &touchscreen_mode,
- NULL);
+ current_event = gtk_get_current_event ();
- if (!touchscreen_mode && priv->submenu &&
+ if (current_event)
+ {
+ source_device = gdk_event_get_source_device (current_event);
+ gdk_event_free (current_event);
+ }
+
+ if ((!source_device ||
+ gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHSCREEN) &&
+ priv->submenu &&
(!gtk_widget_get_mapped (priv->submenu) ||
GTK_MENU (priv->submenu)->priv->tearoff_active))
{
monitor_num = gdk_screen_get_monitor_at_window (screen, priv->event_window);
if (monitor_num < 0)
monitor_num = 0;
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+ gdk_screen_get_monitor_workarea (screen, monitor_num, &monitor);
if (!gdk_window_get_origin (gtk_widget_get_window (widget), &tx, &ty))
{