xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
xmenu.c (menu_position_func): Adjust menu popup position so that the menu is fully visible.
This commit is contained in:
parent
fea8973a15
commit
7b76ca1c43
3 changed files with 27 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
2003-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
|
||||
|
||||
* xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
|
||||
|
||||
* xmenu.c (menu_position_func): Adjust menu popup position so that
|
||||
the menu is fully visible.
|
||||
|
||||
|
||||
2003-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
|
||||
|
||||
* xterm.c (x_text_icon, x_raise_frame, x_lower_frame)
|
||||
|
|
21
src/xmenu.c
21
src/xmenu.c
|
@ -2241,6 +2241,7 @@ static Lisp_Object *volatile menu_item_selection;
|
|||
create_and_show_popup_menu below. */
|
||||
struct next_popup_x_y
|
||||
{
|
||||
FRAME_PTR f;
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
@ -2252,7 +2253,7 @@ struct next_popup_x_y
|
|||
PUSH_IN is not documented in the GTK manual.
|
||||
USER_DATA is any data passed in when calling gtk_menu_popup.
|
||||
Here it points to a struct next_popup_x_y where the coordinates
|
||||
to store in *X and *Y are.
|
||||
to store in *X and *Y are as well as the frame for the popup.
|
||||
|
||||
Here only X and Y are used. */
|
||||
static void
|
||||
|
@ -2263,8 +2264,21 @@ menu_position_func (menu, x, y, push_in, user_data)
|
|||
gboolean *push_in;
|
||||
gpointer user_data;
|
||||
{
|
||||
*x = ((struct next_popup_x_y*)user_data)->x;
|
||||
*y = ((struct next_popup_x_y*)user_data)->y;
|
||||
struct next_popup_x_y* data = (struct next_popup_x_y*)user_data;
|
||||
GtkRequisition req;
|
||||
int disp_width = FRAME_X_DISPLAY_INFO (data->f)->width;
|
||||
int disp_height = FRAME_X_DISPLAY_INFO (data->f)->height;
|
||||
|
||||
*x = data->x;
|
||||
*y = data->y;
|
||||
|
||||
/* Check if there is room for the menu. If not, adjust x/y so that
|
||||
the menu is fully visible. */
|
||||
gtk_widget_size_request (GTK_WIDGET (menu), &req);
|
||||
if (data->x + req.width > disp_width)
|
||||
*x -= data->x + req.width - disp_width;
|
||||
if (data->y + req.height > disp_height)
|
||||
*y -= data->y + req.height - disp_height;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2316,6 +2330,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
|
|||
|
||||
popup_x_y.x = x;
|
||||
popup_x_y.y = y;
|
||||
popup_x_y.f = f;
|
||||
}
|
||||
|
||||
/* Display the menu. */
|
||||
|
|
|
@ -13696,6 +13696,7 @@ x_make_frame_visible (f)
|
|||
#else /* not USE_X_TOOLKIT */
|
||||
#ifdef USE_GTK
|
||||
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
|
||||
gtk_window_deiconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
|
||||
#else
|
||||
XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
|
||||
#endif /* not USE_GTK */
|
||||
|
|
Loading…
Add table
Reference in a new issue