Weird event order for key_press blocking correctly handled.
-Yosh
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Mon Apr 20 00:01:26 PDT 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* app/disp_callbacks.c: we get events in a funny order sometimes,
|
||||||
|
so don't try to remove nonexistent signal handlers
|
||||||
|
|
||||||
Sun Apr 19 20:18:29 PDT 1998 Manish Singh <yosh@gimp.org>
|
Sun Apr 19 20:18:29 PDT 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* added screenshot plug-in
|
* added screenshot plug-in
|
||||||
|
@ -140,10 +140,21 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
gtk_grab_add (canvas);
|
gtk_grab_add (canvas);
|
||||||
|
|
||||||
|
/* This is a hack to prevent other stuff being run in the middle of
|
||||||
|
a tool operation (like changing image types.... brrrr). We just
|
||||||
|
block all the keypress event. A better solution is to implement
|
||||||
|
some sort of locking for images.
|
||||||
|
Note that this is dependent on specific GTK behavior, and isn't
|
||||||
|
guaranteed to work in future versions of GTK.
|
||||||
|
-Yosh
|
||||||
|
*/
|
||||||
|
if (key_signal_id == 0)
|
||||||
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
||||||
"key_press_event",
|
"key_press_event",
|
||||||
GTK_SIGNAL_FUNC (gtk_true),
|
GTK_SIGNAL_FUNC (gtk_true),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
!gimage_is_empty (gdisp->gimage)))
|
!gimage_is_empty (gdisp->gimage)))
|
||||||
{
|
{
|
||||||
@ -197,7 +208,13 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
switch (bevent->button)
|
switch (bevent->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
/* Lame hack. See above */
|
||||||
|
if (key_signal_id)
|
||||||
|
{
|
||||||
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
||||||
|
key_signal_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gtk_grab_remove (canvas);
|
gtk_grab_remove (canvas);
|
||||||
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
|
@ -140,10 +140,21 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
gtk_grab_add (canvas);
|
gtk_grab_add (canvas);
|
||||||
|
|
||||||
|
/* This is a hack to prevent other stuff being run in the middle of
|
||||||
|
a tool operation (like changing image types.... brrrr). We just
|
||||||
|
block all the keypress event. A better solution is to implement
|
||||||
|
some sort of locking for images.
|
||||||
|
Note that this is dependent on specific GTK behavior, and isn't
|
||||||
|
guaranteed to work in future versions of GTK.
|
||||||
|
-Yosh
|
||||||
|
*/
|
||||||
|
if (key_signal_id == 0)
|
||||||
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
||||||
"key_press_event",
|
"key_press_event",
|
||||||
GTK_SIGNAL_FUNC (gtk_true),
|
GTK_SIGNAL_FUNC (gtk_true),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
!gimage_is_empty (gdisp->gimage)))
|
!gimage_is_empty (gdisp->gimage)))
|
||||||
{
|
{
|
||||||
@ -197,7 +208,13 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
switch (bevent->button)
|
switch (bevent->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
/* Lame hack. See above */
|
||||||
|
if (key_signal_id)
|
||||||
|
{
|
||||||
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
||||||
|
key_signal_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gtk_grab_remove (canvas);
|
gtk_grab_remove (canvas);
|
||||||
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
|
@ -140,10 +140,21 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
gtk_grab_add (canvas);
|
gtk_grab_add (canvas);
|
||||||
|
|
||||||
|
/* This is a hack to prevent other stuff being run in the middle of
|
||||||
|
a tool operation (like changing image types.... brrrr). We just
|
||||||
|
block all the keypress event. A better solution is to implement
|
||||||
|
some sort of locking for images.
|
||||||
|
Note that this is dependent on specific GTK behavior, and isn't
|
||||||
|
guaranteed to work in future versions of GTK.
|
||||||
|
-Yosh
|
||||||
|
*/
|
||||||
|
if (key_signal_id == 0)
|
||||||
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
key_signal_id = gtk_signal_connect (GTK_OBJECT (canvas),
|
||||||
"key_press_event",
|
"key_press_event",
|
||||||
GTK_SIGNAL_FUNC (gtk_true),
|
GTK_SIGNAL_FUNC (gtk_true),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
!gimage_is_empty (gdisp->gimage)))
|
!gimage_is_empty (gdisp->gimage)))
|
||||||
{
|
{
|
||||||
@ -197,7 +208,13 @@ gdisplay_canvas_events (GtkWidget *canvas,
|
|||||||
switch (bevent->button)
|
switch (bevent->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
/* Lame hack. See above */
|
||||||
|
if (key_signal_id)
|
||||||
|
{
|
||||||
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
gtk_signal_disconnect (GTK_OBJECT (canvas), key_signal_id);
|
||||||
|
key_signal_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gtk_grab_remove (canvas);
|
gtk_grab_remove (canvas);
|
||||||
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
gdk_pointer_ungrab (bevent->time); /* fixes pointer grab bug */
|
||||||
if (active_tool && ((active_tool->type == MOVE) ||
|
if (active_tool && ((active_tool->type == MOVE) ||
|
||||||
|
@ -37,6 +37,7 @@ scriptdata_DATA = \
|
|||||||
copy-visible.scm \
|
copy-visible.scm \
|
||||||
crystal-logo.scm \
|
crystal-logo.scm \
|
||||||
drop-shadow.scm \
|
drop-shadow.scm \
|
||||||
|
egg.scm \
|
||||||
erase-rows.scm \
|
erase-rows.scm \
|
||||||
flatland.scm \
|
flatland.scm \
|
||||||
font-map.scm \
|
font-map.scm \
|
||||||
|
17
plug-ins/script-fu/scripts/egg.scm
Normal file
17
plug-ins/script-fu/scripts/egg.scm
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
; Aspirin and Yosh present: Fun with eggs
|
||||||
|
;
|
||||||
|
|
||||||
|
(define (script-fu-egg-catcher coolfile)
|
||||||
|
(let* ((image (car (gimp-file-load 1 coolfile coolfile)))
|
||||||
|
(drawable (car (gimp-image-active-drawable image))))
|
||||||
|
(plug-in-the-egg 1 image drawable)
|
||||||
|
(gimp-display-new image)))
|
||||||
|
|
||||||
|
(script-fu-register "script-fu-egg-catcher"
|
||||||
|
"<None>"
|
||||||
|
"Invoke The Egg!"
|
||||||
|
"Adam D. Moss & Manish Singh"
|
||||||
|
"Adam D. Moss & Manish Singh"
|
||||||
|
"1998/04/19"
|
||||||
|
""
|
||||||
|
SF-VALUE "Cool File" "foo.xcf")
|
Reference in New Issue
Block a user