summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--ChangeLog.pre-2-015
-rw-r--r--ChangeLog.pre-2-1015
-rw-r--r--ChangeLog.pre-2-215
-rw-r--r--ChangeLog.pre-2-415
-rw-r--r--ChangeLog.pre-2-615
-rw-r--r--ChangeLog.pre-2-815
-rw-r--r--gdk/gdkwindow.c24
-rw-r--r--gdk/x11/gdkwindow-x11.c24
-rw-r--r--gtk/gtkcheckbutton.c38
-rw-r--r--gtk/gtkmain.c8
-rw-r--r--gtk/gtkmain.h23
-rw-r--r--gtk/gtkradiobutton.c15
-rw-r--r--gtk/gtktogglebutton.c6
-rw-r--r--gtk/gtkwidget.c11
15 files changed, 208 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 3cadc4db26..119c318f8c 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,18 @@
+Tue Feb 17 05:41:31 1998 Tim Janik <timj@gimp.org>
+
+ * gtk/gtkcheckbutton.c:
+ * gtk/gtkradiobutton.c:
+ * gtk/gtktogglebutton.c:
+ applied patch to fix draw_indicator behaviour from Lars Hamann
+ and Stefan Jeske.
+
+ * gtk/gtkmain.h:
+ * gtk/gtkmain.c (gtk_grab_get_current): new function
+ that returns the current grab widget or NULL.
+
+ * gdk/gdkwindow.c (gdk_window_shape_combine_mask): remove
+ shape mask if mask==NULL (provided by Stefan Wille).
+
Tue Feb 17 00:06:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpaned.c, gtk/gtk[hv]paned.c: (gtk-fortier-980215-0)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 129fea3b7c..90cfa4a5e0 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1255,21 +1255,33 @@ gdk_window_shape_combine_mask (GdkWindow *window,
gint x, gint y)
{
GdkWindowPrivate *window_private;
- GdkWindowPrivate *pixmap_private;
+ Pixmap pixmap;
g_return_if_fail (window != NULL);
- g_return_if_fail (mask != NULL);
window_private = (GdkWindowPrivate*) window;
- pixmap_private = (GdkWindowPrivate*) mask;
if (window_private->destroyed)
return;
-
+
+ if (mask)
+ {
+ GdkWindowPrivate *pixmap_private;
+
+ pixmap_private = (GdkWindowPrivate*) mask;
+ pixmap = (Pixmap) pixmap_private->xwindow;
+ }
+ else
+ {
+ x = 0;
+ y = 0;
+ pixmap = None;
+ }
+
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
- x, y, /* offset */
- (Pixmap)pixmap_private->xwindow,
+ x, y,
+ pixmap,
ShapeSet);
}
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 129fea3b7c..90cfa4a5e0 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1255,21 +1255,33 @@ gdk_window_shape_combine_mask (GdkWindow *window,
gint x, gint y)
{
GdkWindowPrivate *window_private;
- GdkWindowPrivate *pixmap_private;
+ Pixmap pixmap;
g_return_if_fail (window != NULL);
- g_return_if_fail (mask != NULL);
window_private = (GdkWindowPrivate*) window;
- pixmap_private = (GdkWindowPrivate*) mask;
if (window_private->destroyed)
return;
-
+
+ if (mask)
+ {
+ GdkWindowPrivate *pixmap_private;
+
+ pixmap_private = (GdkWindowPrivate*) mask;
+ pixmap = (Pixmap) pixmap_private->xwindow;
+ }
+ else
+ {
+ x = 0;
+ y = 0;
+ pixmap = None;
+ }
+
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
- x, y, /* offset */
- (Pixmap)pixmap_private->xwindow,
+ x, y,
+ pixmap,
ShapeSet);
}
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 9266120179..c7244f3c41 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -157,25 +157,30 @@ static void
gtk_check_button_draw_focus (GtkWidget *widget)
{
GtkCheckButton *check_button;
-
+
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
-
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
+
+ if (GTK_WIDGET_DRAWABLE (widget))
{
check_button = GTK_CHECK_BUTTON (widget);
if (check_button->toggle_button.draw_indicator)
{
+ gint border_width;
+
+ border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_HAS_FOCUS (widget))
gdk_draw_rectangle (widget->window,
- widget->style->black_gc, FALSE, 0, 0,
- widget->allocation.width - 1,
- widget->allocation.height - 1);
+ widget->style->black_gc, FALSE,
+ border_width, border_width,
+ widget->allocation.width - 2 * border_width - 1,
+ widget->allocation.height - 2 * border_width - 1);
else
gdk_draw_rectangle (widget->window,
- widget->style->bg_gc[GTK_STATE_NORMAL], FALSE, 0, 0,
- widget->allocation.width - 1,
- widget->allocation.height - 1);
+ widget->style->bg_gc[GTK_STATE_NORMAL], FALSE,
+ border_width, border_width,
+ widget->allocation.width - 2 * border_width - 1,
+ widget->allocation.height - 2 * border_width - 1);
}
else
{
@@ -322,6 +327,8 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
GtkToggleButton *toggle_button;
GtkStateType state_type;
GtkShadowType shadow_type;
+ GdkRectangle restrict_area;
+ GdkRectangle new_area;
gint width, height;
gint x, y;
@@ -338,9 +345,18 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
(state_type != GTK_STATE_PRELIGHT))
state_type = GTK_STATE_NORMAL;
- gtk_style_set_background (widget->style, widget->window, state_type);
- gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+ restrict_area.x = GTK_CONTAINER (widget)->border_width;
+ restrict_area.y = restrict_area.x;
+ restrict_area.width = widget->allocation.width - restrict_area.x * 2;
+ restrict_area.height = widget->allocation.height - restrict_area.x * 2;
+ if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
+ {
+ gtk_style_set_background (widget->style, widget->window, state_type);
+ gdk_window_clear_area (widget->window, new_area.x, new_area.y,
+ new_area.width, new_area.height);
+ }
+
x = CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
y = (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
width = CHECK_BUTTON_CLASS (widget)->indicator_size;
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index c9612b45a3..2980150e01 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -514,6 +514,14 @@ gtk_grab_add (GtkWidget *widget)
}
}
+GtkWidget*
+gtk_grab_get_current (void)
+{
+ if (grabs)
+ return GTK_WIDGET (grabs->data);
+ return NULL;
+}
+
void
gtk_grab_remove (GtkWidget *widget)
{
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index 8b2009a7eb..0dbd4cc43c 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -51,20 +51,21 @@ gint gtk_main_iteration (void);
/* gtk_main_iteration() calls gtk_main_iteration_do(TRUE) */
gint gtk_main_iteration_do (gboolean blocking);
-gint gtk_true (void);
-gint gtk_false (void);
+gint gtk_true (void);
+gint gtk_false (void);
-void gtk_grab_add (GtkWidget *widget);
-void gtk_grab_remove (GtkWidget *widget);
+void gtk_grab_add (GtkWidget *widget);
+GtkWidget* gtk_grab_get_current (void);
+void gtk_grab_remove (GtkWidget *widget);
-void gtk_init_add (GtkFunction function,
- gpointer data);
+void gtk_init_add (GtkFunction function,
+ gpointer data);
-gint gtk_timeout_add_full (guint32 interval,
- GtkFunction function,
- GtkCallbackMarshal marshal,
- gpointer data,
- GtkDestroyNotify destroy);
+gint gtk_timeout_add_full (guint32 interval,
+ GtkFunction function,
+ GtkCallbackMarshal marshal,
+ gpointer data,
+ GtkDestroyNotify destroy);
gint gtk_timeout_add (guint32 interval,
GtkFunction function,
gpointer data);
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 1e9a36886b..17b9800277 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -270,6 +270,8 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
GtkToggleButton *toggle_button;
GtkStateType state_type;
GtkShadowType shadow_type;
+ GdkRectangle restrict_area;
+ GdkRectangle new_area;
GdkPoint pts[4];
gint width, height;
gint x, y;
@@ -288,9 +290,18 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
(state_type != GTK_STATE_PRELIGHT))
state_type = GTK_STATE_NORMAL;
- gtk_style_set_background (widget->style, widget->window, state_type);
- gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+ restrict_area.x = GTK_CONTAINER (widget)->border_width;
+ restrict_area.y = restrict_area.x;
+ restrict_area.width = widget->allocation.width - restrict_area.x * 2;
+ restrict_area.height = widget->allocation.height - restrict_area.x * 2;
+ if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
+ {
+ gtk_style_set_background (widget->style, widget->window, state_type);
+ gdk_window_clear_area (widget->window, new_area.x, new_area.y,
+ new_area.width, new_area.height);
+ }
+
x = CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
y = (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
width = CHECK_BUTTON_CLASS (widget)->indicator_size;
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index be39f8b1f5..fa1e3c2adf 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -181,15 +181,15 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
+ if (GTK_WIDGET_DRAWABLE (widget))
{
button = GTK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
x = 0;
y = 0;
- width = widget->allocation.width;
- height = widget->allocation.height;
+ width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
+ height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6f3f265412..024c648c01 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3728,20 +3728,17 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
{
GTK_PRIVATE_UNSET_FLAG (widget, GTK_HAS_SHAPE_MASK);
+ if (widget->window)
+ gdk_window_shape_combine_mask (widget->window, NULL, 0, 0);
+
shape_info = gtk_object_get_data (GTK_OBJECT (widget), shape_info_key);
gtk_object_remove_data (GTK_OBJECT (widget), shape_info_key);
g_free (shape_info);
-
- if (widget->window)
- {
- /* FIXME: we need gdk code here that removes the shape from a window
- */
- }
}
else
{
GTK_PRIVATE_SET_FLAG (widget, GTK_HAS_SHAPE_MASK);
-
+
shape_info = gtk_object_get_data (GTK_OBJECT (widget), shape_info_key);
if (!shape_info)
{