Skip to content

Commit

Permalink
Merge pull request #212 from rilian-la-te/fix_expand
Browse files Browse the repository at this point in the history
Fix expand
  • Loading branch information
stefano-k committed Jun 25, 2014
2 parents 4a769cc + 5185103 commit 67c9f12
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 42 deletions.
4 changes: 4 additions & 0 deletions applets/notification_area/na-tray.c
Expand Up @@ -247,13 +247,17 @@ tray_removed (NaTrayManager *manager,
TraysScreen *trays_screen)
{
NaTray *tray;
NaTrayPrivate *priv;

tray = g_hash_table_lookup (trays_screen->icon_table, icon);
if (tray == NULL)
return;

priv = tray->priv;
g_assert (tray->priv->trays_screen == trays_screen);

gtk_container_remove (GTK_CONTAINER (priv->box), icon);

g_hash_table_remove (trays_screen->icon_table, icon);
/* this will also destroy the tip associated to this icon */
g_hash_table_remove (trays_screen->tip_table, icon);
Expand Down
8 changes: 6 additions & 2 deletions libmate-panel-applet/mate-panel-applet.c
Expand Up @@ -2211,7 +2211,9 @@ mate_panel_applet_class_init (MatePanelAppletClass *klass)
g_param_spec_uint ("orient",
"Orient",
"Panel Applet Orientation",
0, G_MAXUINT, 0, /* FIXME */
MATE_PANEL_APPLET_ORIENT_FIRST,
MATE_PANEL_APPLET_ORIENT_LAST,
MATE_PANEL_APPLET_ORIENT_UP,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SIZE,
Expand All @@ -2232,7 +2234,9 @@ mate_panel_applet_class_init (MatePanelAppletClass *klass)
g_param_spec_uint ("flags",
"Flags",
"Panel Applet flags",
0, G_MAXUINT, 0, /* FIXME */
MATE_PANEL_APPLET_FLAGS_NONE,
MATE_PANEL_APPLET_FLAGS_ALL,
MATE_PANEL_APPLET_FLAGS_NONE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SIZE_HINTS,
Expand Down
3 changes: 3 additions & 0 deletions libmate-panel-applet/mate-panel-applet.h
Expand Up @@ -42,6 +42,8 @@ typedef enum {
MATE_PANEL_APPLET_ORIENT_DOWN,
MATE_PANEL_APPLET_ORIENT_LEFT,
MATE_PANEL_APPLET_ORIENT_RIGHT
#define MATE_PANEL_APPLET_ORIENT_FIRST MATE_PANEL_APPLET_ORIENT_UP
#define MATE_PANEL_APPLET_ORIENT_LAST MATE_PANEL_APPLET_ORIENT_RIGHT
} MatePanelAppletOrient;

#define PANEL_TYPE_APPLET (mate_panel_applet_get_type ())
Expand All @@ -62,6 +64,7 @@ typedef enum {
MATE_PANEL_APPLET_EXPAND_MAJOR = 1 << 0,
MATE_PANEL_APPLET_EXPAND_MINOR = 1 << 1,
MATE_PANEL_APPLET_HAS_HANDLE = 1 << 2
#define MATE_PANEL_APPLET_FLAGS_ALL (MATE_PANEL_APPLET_EXPAND_MAJOR|MATE_PANEL_APPLET_EXPAND_MINOR|MATE_PANEL_APPLET_HAS_HANDLE)
} MatePanelAppletFlags;

typedef struct _MatePanelApplet MatePanelApplet;
Expand Down
9 changes: 8 additions & 1 deletion mate-panel/applet.c
Expand Up @@ -598,6 +598,9 @@ mate_panel_applet_position_menu (GtkMenu *menu,
{
GtkAllocation allocation;
GtkRequisition requisition;
#if GTK_CHECK_VERSION(3, 0, 0)
GdkDevice *device;
#endif
GdkScreen *screen;
GtkWidget *parent;
int menu_x = 0;
Expand All @@ -618,8 +621,12 @@ mate_panel_applet_position_menu (GtkMenu *menu,
#endif

gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y);
#if GTK_CHECK_VERSION (3, 0, 0)
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (applet)));
gdk_window_get_device_position(gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL);
#else
gtk_widget_get_pointer (applet, &pointer_x, &pointer_y);

#endif
gtk_widget_get_allocation (applet, &allocation);

if (!gtk_widget_get_has_window (applet)) {
Expand Down
15 changes: 10 additions & 5 deletions mate-panel/mate-panel-applet-frame.c
Expand Up @@ -135,11 +135,16 @@ mate_panel_applet_frame_draw (GtkWidget *widget,
cairo_pattern_destroy (bg_pattern);
}

cairo_rectangle (cr,
frame->priv->handle_rect.x,
frame->priv->handle_rect.y,
frame->priv->handle_rect.width,
frame->priv->handle_rect.height);
cairo_clip (cr);
gtk_render_handle (context, cr,
frame->priv->handle_rect.x,
frame->priv->handle_rect.y,
frame->priv->handle_rect.width,
frame->priv->handle_rect.height);
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));

cairo_restore (cr);

Expand Down Expand Up @@ -951,7 +956,7 @@ mate_panel_applet_frame_activating_free (MatePanelAppletFrameActivating *frame_a
GdkScreen *
panel_applet_frame_activating_get_screen (MatePanelAppletFrameActivating *frame_act)
{
return gtk_widget_get_screen (frame_act->panel);
return gtk_widget_get_screen (GTK_WIDGET(frame_act->panel));
}

PanelOrientation
Expand Down

0 comments on commit 67c9f12

Please sign in to comment.