mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
...
This commit is contained in:
parent
3650c23055
commit
ec00c9852d
73
src/frames.c
73
src/frames.c
@ -709,28 +709,42 @@ meta_frames_manage_window (MetaFrames *frames,
|
||||
|
||||
gdk_window_set_user_data (frame->window, frames);
|
||||
|
||||
#if 0
|
||||
/* Add events in frame.c */
|
||||
gdk_window_set_events (frame->window,
|
||||
GDK_EXPOSURE_MASK |
|
||||
GDK_POINTER_MOTION_MASK |
|
||||
GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_STRUCTURE_MASK);
|
||||
/* Don't set event mask here, it's in frame.c */
|
||||
|
||||
/* This shouldn't be required if we don't select for button
|
||||
* press in frame.c?
|
||||
/* Grab Alt + button1 and Alt + button2 for moving window,
|
||||
* and Alt + button3 for popping up window menu.
|
||||
*/
|
||||
XGrabButton (gdk_display, AnyButton, AnyModifier,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None);
|
||||
{
|
||||
int i = 1;
|
||||
while (i < 4)
|
||||
{
|
||||
if (XGrabButton (gdk_display, i, Mod1Mask,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None) != Success)
|
||||
meta_warning ("Failed to grab button %d with Mod1Mask for frame 0x%lx\n",
|
||||
i, xwindow);
|
||||
|
||||
#if 0
|
||||
/* This is just for debugging, since I end up moving
|
||||
* the Xnest otherwise ;-)
|
||||
*/
|
||||
if (XGrabButton (gdk_display, i, ControlMask,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None) != Success)
|
||||
meta_warning ("Failed to grab button %d with ControlMask for frame 0x%lx\n",
|
||||
i, xwindow);
|
||||
|
||||
XFlush (gdk_display);
|
||||
#endif
|
||||
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
frame->xwindow = xwindow;
|
||||
frame->layout = NULL;
|
||||
@ -1362,14 +1376,12 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
|
||||
g_assert (status != META_FRAME_STATUS_NORMAL);
|
||||
|
||||
meta_frames_begin_grab (frames, frame,
|
||||
status,
|
||||
event->button,
|
||||
0, 0, 0, 0, 0, 0, /* not needed */
|
||||
event->time);
|
||||
|
||||
|
||||
redraw_control (frames, frame, control);
|
||||
|
||||
if (status == META_FRAME_STATUS_CLICKING_MENU)
|
||||
@ -1487,6 +1499,15 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
event->time);
|
||||
}
|
||||
}
|
||||
else if (event->button == 3)
|
||||
{
|
||||
meta_core_show_window_menu (gdk_display,
|
||||
frame->xwindow,
|
||||
event->x_root,
|
||||
event->y_root,
|
||||
event->button,
|
||||
event->time);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -2411,3 +2432,13 @@ get_control (MetaFrames *frames,
|
||||
|
||||
return META_FRAME_CONTROL_NONE;
|
||||
}
|
||||
|
||||
Window
|
||||
meta_frames_get_moving_frame (MetaFrames *frames)
|
||||
{
|
||||
if (frames->grab_frame &&
|
||||
frames->grab_status == META_FRAME_STATUS_MOVING)
|
||||
return frames->grab_frame->xwindow;
|
||||
else
|
||||
return None;
|
||||
}
|
||||
|
@ -157,4 +157,6 @@ void meta_frames_get_pixmap_for_control (MetaFrames *frames,
|
||||
|
||||
void meta_frames_notify_menu_hide (MetaFrames *frames);
|
||||
|
||||
Window meta_frames_get_moving_frame (MetaFrames *frames);
|
||||
|
||||
#endif
|
||||
|
@ -286,7 +286,47 @@ handle_activate_workspace (MetaDisplay *display,
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
Window move_frame;
|
||||
MetaWindow *move_window;
|
||||
|
||||
move_window = NULL;
|
||||
move_frame = meta_ui_get_moving_frame (workspace->screen->ui);
|
||||
|
||||
if (move_frame != None)
|
||||
{
|
||||
move_window = meta_display_lookup_x_window (display, move_frame);
|
||||
|
||||
if (move_window == NULL ||
|
||||
move_window->frame == NULL)
|
||||
meta_bug ("No move_frame window 0x%lx!\n", move_frame);
|
||||
|
||||
if (move_window->on_all_workspaces)
|
||||
move_window = NULL; /* don't move it after all */
|
||||
|
||||
/* We put the window on the new workspace, flip spaces,
|
||||
* then remove from old workspace, so the window
|
||||
* never gets unmapped and we maintain the button grab
|
||||
* on it.
|
||||
*/
|
||||
if (move_window)
|
||||
{
|
||||
if (!meta_workspace_contains_window (workspace,
|
||||
move_window))
|
||||
meta_workspace_add_window (workspace, move_window);
|
||||
}
|
||||
}
|
||||
|
||||
meta_workspace_activate (workspace);
|
||||
|
||||
if (move_window)
|
||||
{
|
||||
/* Lamely rely on prepend */
|
||||
g_assert (move_window->workspaces->data == workspace);
|
||||
|
||||
while (move_window->workspaces->next) /* while list size > 1 */
|
||||
meta_workspace_remove_window (move_window->workspaces->next->data,
|
||||
move_window);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ meta_window_place (MetaWindow *window,
|
||||
/* Center on screen */
|
||||
int w, h;
|
||||
|
||||
/* I think whole screen will look nicer than workarea */
|
||||
/* I think whole screen will look nicer than workarea */
|
||||
w = WidthOfScreen (window->screen->xscreen);
|
||||
h = HeightOfScreen (window->screen->xscreen);
|
||||
|
||||
|
6
src/ui.c
6
src/ui.c
@ -151,6 +151,12 @@ meta_ui_remove_frame (MetaUI *ui,
|
||||
meta_frames_unmanage_window (ui->frames, xwindow);
|
||||
}
|
||||
|
||||
Window
|
||||
meta_ui_get_moving_frame (MetaUI *ui)
|
||||
{
|
||||
return meta_frames_get_moving_frame (ui->frames);
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_map_frame (MetaUI *ui,
|
||||
Window xwindow)
|
||||
|
3
src/ui.h
3
src/ui.h
@ -55,6 +55,9 @@ void meta_ui_add_frame (MetaUI *ui,
|
||||
void meta_ui_remove_frame (MetaUI *ui,
|
||||
Window xwindow);
|
||||
|
||||
Window meta_ui_get_moving_frame (MetaUI *ui);
|
||||
|
||||
|
||||
/* GDK insists on tracking map/unmap */
|
||||
void meta_ui_map_frame (MetaUI *ui,
|
||||
Window xwindow);
|
||||
|
@ -604,6 +604,8 @@ void
|
||||
meta_window_calc_showing (MetaWindow *window)
|
||||
{
|
||||
gboolean on_workspace;
|
||||
|
||||
meta_verbose ("Calc showing for window %s\n", window->desc);
|
||||
|
||||
on_workspace = g_list_find (window->workspaces,
|
||||
window->screen->active_workspace) != NULL;
|
||||
@ -655,6 +657,8 @@ idle_calc_showing (gpointer data)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
meta_verbose ("Clearing the calc_showing queue\n");
|
||||
|
||||
/* sort them from bottom to top, so we map the
|
||||
* bottom windows first, so that placement (e.g. cascading)
|
||||
* works properly
|
||||
@ -1485,7 +1489,7 @@ meta_window_change_workspace (MetaWindow *window,
|
||||
/* See if we're already on this space */
|
||||
if (g_list_find (window->workspaces, workspace) != NULL)
|
||||
{
|
||||
meta_verbose ("Already on this workspace\n");
|
||||
meta_verbose ("%s already on this workspace\n", window->desc);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user