mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
Add screen argument to meta_display_get_tab_next, since we only want
2002-05-11 Anders Carlsson <andersca@gnu.org> * src/display.c: (find_tab_forward), (find_tab_backward), (meta_display_get_tab_next): * src/display.h: * src/keybindings.c: (handle_tab_forward), (handle_focus_previous): Add screen argument to meta_display_get_tab_next, since we only want windows on the same screen to appear in the tab chain. * src/screen.c: (meta_screen_new): Or the event mask with existing events since gtk+ may listen to certain events and we don't want to disable those events. (meta_screen_ensure_tab_popup): * src/tabpopup.c: (meta_ui_tab_popup_new): * src/tabpopup.h: Add a screen number argument to meta_ui_tab_popup_new so we can position the popup on the correct screen.
This commit is contained in:
parent
41e99288b5
commit
af83598ad3
20
ChangeLog
20
ChangeLog
@ -1,3 +1,22 @@
|
||||
2002-05-11 Anders Carlsson <andersca@gnu.org>
|
||||
|
||||
* src/display.c: (find_tab_forward), (find_tab_backward),
|
||||
(meta_display_get_tab_next):
|
||||
* src/display.h:
|
||||
* src/keybindings.c: (handle_tab_forward), (handle_focus_previous):
|
||||
Add screen argument to meta_display_get_tab_next, since we only
|
||||
want windows on the same screen to appear in the tab chain.
|
||||
|
||||
* src/screen.c: (meta_screen_new):
|
||||
Or the event mask with existing events since gtk+ may listen to
|
||||
certain events and we don't want to disable those events.
|
||||
|
||||
(meta_screen_ensure_tab_popup):
|
||||
* src/tabpopup.c: (meta_ui_tab_popup_new):
|
||||
* src/tabpopup.h:
|
||||
Add a screen number argument to meta_ui_tab_popup_new so we
|
||||
can position the popup on the correct screen.
|
||||
|
||||
2002-05-11 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/main.c: include locale.h, fix from Hidetoshi Tajima
|
||||
@ -47,6 +66,7 @@
|
||||
the calc_showing, don't focus it, it's probably on another
|
||||
workspace or something.
|
||||
|
||||
>>>>>>> 1.239
|
||||
2002-05-09 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/frames.c (show_tip_now): DefaultScreen() returns the screen
|
||||
|
@ -2615,19 +2615,21 @@ meta_display_window_has_pending_pings (MetaDisplay *display,
|
||||
static MetaWindow*
|
||||
find_tab_forward (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace,
|
||||
GList *start)
|
||||
{
|
||||
GList *tmp;
|
||||
|
||||
g_return_val_if_fail (start != NULL, NULL);
|
||||
|
||||
|
||||
tmp = start->next;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWindow *window = tmp->data;
|
||||
|
||||
if (IN_TAB_CHAIN (window, type) &&
|
||||
if (window->screen == screen &&
|
||||
IN_TAB_CHAIN (window, type) &&
|
||||
(workspace == NULL ||
|
||||
meta_window_visible_on_workspace (window, workspace)))
|
||||
return window;
|
||||
@ -2654,6 +2656,7 @@ find_tab_forward (MetaDisplay *display,
|
||||
static MetaWindow*
|
||||
find_tab_backward (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace,
|
||||
GList *start)
|
||||
{
|
||||
@ -2666,7 +2669,8 @@ find_tab_backward (MetaDisplay *display,
|
||||
{
|
||||
MetaWindow *window = tmp->data;
|
||||
|
||||
if (IN_TAB_CHAIN (window, type) &&
|
||||
if (window->screen == screen &&
|
||||
IN_TAB_CHAIN (window, type) &&
|
||||
(workspace == NULL ||
|
||||
meta_window_visible_on_workspace (window, workspace)))
|
||||
return window;
|
||||
@ -2727,6 +2731,7 @@ meta_display_get_tab_list (MetaDisplay *display,
|
||||
MetaWindow*
|
||||
meta_display_get_tab_next (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *window,
|
||||
gboolean backward)
|
||||
@ -2739,20 +2744,20 @@ meta_display_get_tab_next (MetaDisplay *display,
|
||||
g_assert (window->display == display);
|
||||
|
||||
if (backward)
|
||||
return find_tab_backward (display, type, workspace,
|
||||
return find_tab_backward (display, type, screen, workspace,
|
||||
g_list_find (display->mru_list,
|
||||
window));
|
||||
else
|
||||
return find_tab_forward (display, type, workspace,
|
||||
return find_tab_forward (display, type, screen, workspace,
|
||||
g_list_find (display->mru_list,
|
||||
window));
|
||||
}
|
||||
|
||||
if (backward)
|
||||
return find_tab_backward (display, type, workspace,
|
||||
return find_tab_backward (display, type, screen, workspace,
|
||||
g_list_last (display->mru_list));
|
||||
else
|
||||
return find_tab_forward (display, type, workspace,
|
||||
return find_tab_forward (display, type, screen, workspace,
|
||||
display->mru_list);
|
||||
}
|
||||
|
||||
|
@ -307,6 +307,7 @@ GSList* meta_display_get_tab_list (MetaDisplay *display,
|
||||
|
||||
MetaWindow* meta_display_get_tab_next (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *window,
|
||||
gboolean backward);
|
||||
|
@ -1439,6 +1439,7 @@ handle_tab_forward (MetaDisplay *display,
|
||||
{
|
||||
window = meta_display_get_tab_next (display,
|
||||
type,
|
||||
display->focus_window->screen,
|
||||
display->focus_window->screen->active_workspace,
|
||||
display->focus_window,
|
||||
backward);
|
||||
@ -1458,6 +1459,7 @@ handle_tab_forward (MetaDisplay *display,
|
||||
{
|
||||
window = meta_display_get_tab_next (screen->display,
|
||||
type,
|
||||
screen,
|
||||
screen->active_workspace,
|
||||
NULL,
|
||||
backward);
|
||||
@ -1525,6 +1527,7 @@ handle_focus_previous (MetaDisplay *display,
|
||||
/* Pick first window in tab order */
|
||||
window = meta_display_get_tab_next (screen->display,
|
||||
META_TAB_LIST_NORMAL,
|
||||
screen,
|
||||
screen->active_workspace,
|
||||
NULL,
|
||||
TRUE);
|
||||
|
15
src/screen.c
15
src/screen.c
@ -165,6 +165,8 @@ meta_screen_new (MetaDisplay *display,
|
||||
MetaScreen *screen;
|
||||
Window xroot;
|
||||
Display *xdisplay;
|
||||
XWindowAttributes attr;
|
||||
|
||||
int xinerama_event_base, xinerama_error_base;
|
||||
|
||||
/* Only display->name, display->xdisplay, and display->error_traps
|
||||
@ -191,13 +193,18 @@ meta_screen_new (MetaDisplay *display,
|
||||
|
||||
/* Select our root window events */
|
||||
meta_error_trap_push (display);
|
||||
|
||||
/* We need to or with the existing event mask since
|
||||
* gtk+ may be interested in other events.
|
||||
*/
|
||||
XGetWindowAttributes (xdisplay, xroot, &attr);
|
||||
XSelectInput (xdisplay,
|
||||
xroot,
|
||||
SubstructureRedirectMask | SubstructureNotifyMask |
|
||||
ColormapChangeMask | PropertyChangeMask |
|
||||
LeaveWindowMask | EnterWindowMask |
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
FocusChangeMask);
|
||||
FocusChangeMask | attr.your_event_mask);
|
||||
if (meta_error_trap_pop (display) != Success)
|
||||
{
|
||||
meta_warning (_("Screen %d on display '%s' already has a window manager\n"),
|
||||
@ -683,7 +690,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
|
||||
GSList *tmp;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
|
||||
if (screen->tab_popup)
|
||||
return;
|
||||
|
||||
@ -747,8 +754,8 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
|
||||
++i;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
screen->tab_popup = meta_ui_tab_popup_new (entries);
|
||||
|
||||
screen->tab_popup = meta_ui_tab_popup_new (entries, screen->number);
|
||||
g_free (entries);
|
||||
|
||||
g_slist_free (tab_list);
|
||||
|
@ -19,6 +19,8 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "core.h"
|
||||
#include "tabpopup.h"
|
||||
@ -90,7 +92,8 @@ outline_window_expose (GtkWidget *widget,
|
||||
}
|
||||
|
||||
MetaTabPopup*
|
||||
meta_ui_tab_popup_new (const MetaTabEntry *entries)
|
||||
meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
||||
int screen_number)
|
||||
{
|
||||
MetaTabPopup *popup;
|
||||
int i, left, right, top, bottom;
|
||||
@ -103,10 +106,16 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries)
|
||||
GList *tmp;
|
||||
GtkWidget *frame;
|
||||
int max_label_width;
|
||||
|
||||
|
||||
popup = g_new (MetaTabPopup, 1);
|
||||
|
||||
popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
gtk_window_set_screen (GTK_WINDOW (popup->outline_window),
|
||||
gdk_display_get_screen (gdk_get_default_display (),
|
||||
screen_number));
|
||||
#endif
|
||||
|
||||
gtk_widget_set_app_paintable (popup->outline_window, TRUE);
|
||||
gtk_widget_realize (popup->outline_window);
|
||||
|
||||
@ -114,6 +123,12 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries)
|
||||
G_CALLBACK (outline_window_expose), popup);
|
||||
|
||||
popup->window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
gtk_window_set_screen (GTK_WINDOW (popup->window),
|
||||
gdk_display_get_screen (gdk_get_default_display (),
|
||||
screen_number));
|
||||
#endif
|
||||
|
||||
gtk_window_set_position (GTK_WINDOW (popup->window),
|
||||
GTK_WIN_POS_CENTER_ALWAYS);
|
||||
/* enable resizing, to get never-shrink behavior */
|
||||
|
@ -40,7 +40,8 @@ struct _MetaTabEntry
|
||||
int inner_x, inner_y, inner_width, inner_height;
|
||||
};
|
||||
|
||||
MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries);
|
||||
MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
||||
int screen_number);
|
||||
void meta_ui_tab_popup_free (MetaTabPopup *popup);
|
||||
void meta_ui_tab_popup_set_showing (MetaTabPopup *popup,
|
||||
gboolean showing);
|
||||
|
Loading…
Reference in New Issue
Block a user