Compare commits

...

5 Commits

Author SHA1 Message Date
Florian Müllner
54df7934ea Bump version to 3.11.91
Update NEWS.
2014-03-05 23:48:33 +01:00
Florian Müllner
9052efb0d9 build: Use non-deprecated feature test macros
_SVID_SOURCE has been deprecated in newer versions of glibc breaking
-WError; the recommended replacement of _DEFAULT_SOURCE is fairly
new, so switch to _XOPEN_SOURCE instead.
2014-03-05 23:48:33 +01:00
Owen W. Taylor
b346f98eb0 Fix positioning error for manually positioned windows
The "original coordinates" passed into meta_window_place() were the
coordinates of the client rectangle not the frame rectangle. When
meta_window_place() didn't place because the window was manually
positioned (e.g., 'xterm -geometry +x+y') that resulted in a window
being offset by the frame dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=724049
2014-03-05 17:22:56 -05:00
Owen W. Taylor
365af53797 Fix handling of dynamic updates to colors/font/etc.
Since the introduction of frame sync in GTK+, updates to titlebar font and
colors haven't been working because GTK+ counts on the frame clock to
do style updates, and the frame clock doesn't run for an unmapped
GdkWindow. (It's possible that GtkStyleContext changes subsequent to
the introduction of the frame clock were also needed to fully break
things.)

We actually need to map the MetaFrames GdkWindow and let the
compositor code send out the frame sync messages in order to pick up
style changes.

Hopefully no bad side effects will occur from this - we make the window
override-redirect, 1x1, and outside the bounds of the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=725751
2014-03-05 17:22:48 -05:00
Giovanni Campagna
bee59ec0e1 Use MetaCursorTracker to query the pointer position
Functionally equivalent in the X11 case, but also correct for
Wayland (where the X server doesn't have the updated pointer
position).

https://bugzilla.gnome.org/show_bug.cgi?id=725525
2014-03-05 23:09:48 +01:00
11 changed files with 81 additions and 124 deletions

14
NEWS
View File

@@ -1,3 +1,17 @@
3.11.91
=======
* Don't use keysym to match keybindings [Rui; #678001]
* Fix message tray icons showing up blank (again) [Adel; #725180]
* Improve keybinding lookups [Rui; #725588]
* Fix dynamic updates of titlebar style properties [Owen; #725751]
* Fix positioning of manually positioned windows [Owen; #724049]
* Misc bug fixes and cleanups [Jasper, Carlos, Adel, Giovanni, Florian; #720631,
#724969, #725216, #724402, #722266, #725338, #725525]
Contributors:
Giovanni Campagna, Adel Gadllah, Carlos Garnacho, Rui Matos, Florian Müllner,
Jasper St. Pierre, Owen W. Taylor
3.11.90 3.11.90
======= =======
* Fix double-scaling on high DPI resolutions [Adel; #723931] * Fix double-scaling on high DPI resolutions [Adel; #723931]

View File

@@ -3,7 +3,7 @@ AC_CONFIG_MACRO_DIR([m4])
m4_define([mutter_major_version], [3]) m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [11]) m4_define([mutter_minor_version], [11])
m4_define([mutter_micro_version], [90]) m4_define([mutter_micro_version], [91])
m4_define([mutter_version], m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version]) [mutter_major_version.mutter_minor_version.mutter_micro_version])

View File

@@ -491,12 +491,17 @@ place_window_if_needed(MetaWindow *window,
!window->minimized && !window->minimized &&
!window->fullscreen) !window->fullscreen)
{ {
MetaRectangle orig_rect;
MetaRectangle placed_rect; MetaRectangle placed_rect;
MetaWorkspace *cur_workspace; MetaWorkspace *cur_workspace;
const MetaMonitorInfo *monitor_info; const MetaMonitorInfo *monitor_info;
meta_window_get_frame_rect (window, &placed_rect); meta_window_get_frame_rect (window, &placed_rect);
meta_window_place (window, info->orig.x, info->orig.y,
orig_rect = info->orig;
extend_by_frame (window, &orig_rect);
meta_window_place (window, orig_rect.x, orig_rect.y,
&placed_rect.x, &placed_rect.y); &placed_rect.x, &placed_rect.y);
did_placement = TRUE; did_placement = TRUE;

View File

@@ -42,7 +42,7 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#define _SVID_SOURCE /* for putenv() and some signal-related functions */ #define _XOPEN_SOURCE /* for putenv() and some signal-related functions */
#include <config.h> #include <config.h>
#include <meta/main.h> #include <meta/main.h>

View File

@@ -1076,10 +1076,12 @@ get_pointer_position_gdk (int *x,
gmanager = gdk_display_get_device_manager (gdk_display_get_default ()); gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
gdevice = gdk_device_manager_get_client_pointer (gmanager); gdevice = gdk_device_manager_get_client_pointer (gmanager);
gdk_device_get_position (gdevice, &gscreen, x, y); if (x || y)
gdk_device_get_state (gdevice, gdk_device_get_position (gdevice, &gscreen, x, y);
gdk_screen_get_root_window (gscreen), if (mods)
NULL, (GdkModifierType*)mods); gdk_device_get_state (gdevice,
gdk_screen_get_root_window (gscreen),
NULL, (GdkModifierType*)mods);
} }
static void static void
@@ -1095,9 +1097,12 @@ get_pointer_position_clutter (int *x,
cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE); cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
clutter_input_device_get_coords (cdevice, NULL, &point); clutter_input_device_get_coords (cdevice, NULL, &point);
*x = point.x; if (x)
*y = point.y; *x = point.x;
*mods = clutter_input_device_get_modifier_state (cdevice); if (y)
*y = point.y;
if (mods)
*mods = clutter_input_device_get_modifier_state (cdevice);
} }
void void

View File

@@ -1514,38 +1514,19 @@ meta_screen_get_mouse_window (MetaScreen *screen,
MetaWindow *not_this_one) MetaWindow *not_this_one)
{ {
MetaWindow *window; MetaWindow *window;
Window root_return, child_return; int x, y;
double root_x_return, root_y_return;
double win_x_return, win_y_return;
XIButtonState buttons;
XIModifierState mods;
XIGroupState group;
if (not_this_one) if (not_this_one)
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Focusing mouse window excluding %s\n", not_this_one->desc); "Focusing mouse window excluding %s\n", not_this_one->desc);
meta_error_trap_push (screen->display); meta_cursor_tracker_get_pointer (screen->cursor_tracker,
XIQueryPointer (screen->display->xdisplay, &x, &y, NULL);
META_VIRTUAL_CORE_POINTER_ID,
screen->xroot,
&root_return,
&child_return,
&root_x_return,
&root_y_return,
&win_x_return,
&win_y_return,
&buttons,
&mods,
&group);
meta_error_trap_pop (screen->display);
free (buttons.mask);
window = meta_stack_get_default_focus_window_at_point (screen->stack, window = meta_stack_get_default_focus_window_at_point (screen->stack,
screen->active_workspace, screen->active_workspace,
not_this_one, not_this_one,
root_x_return, x, y);
root_y_return);
return window; return window;
} }
@@ -1827,28 +1808,11 @@ meta_screen_get_current_monitor (MetaScreen *screen)
if (screen->display->monitor_cache_invalidated) if (screen->display->monitor_cache_invalidated)
{ {
Window root_return, child_return; int x, y;
double win_x_return, win_y_return;
double root_x_return, root_y_return;
XIButtonState buttons;
XIModifierState mods;
XIGroupState group;
XIQueryPointer (screen->display->xdisplay, meta_cursor_tracker_get_pointer (screen->cursor_tracker,
META_VIRTUAL_CORE_POINTER_ID, &x, &y, NULL);
screen->xroot, meta_screen_get_current_monitor_for_pos (screen, x, y);
&root_return,
&child_return,
&root_x_return,
&root_y_return,
&win_x_return,
&win_y_return,
&buttons,
&mods,
&group);
free (buttons.mask);
meta_screen_get_current_monitor_for_pos (screen, root_x_return, root_y_return);
} }
return screen->last_monitor_index; return screen->last_monitor_index;

View File

@@ -35,7 +35,7 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#define _SVID_SOURCE /* for gethostname() */ #define _XOPEN_SOURCE 500 /* for gethostname() */
#include <config.h> #include <config.h>
#include "window-props.h" #include "window-props.h"

View File

@@ -38,6 +38,7 @@
#include <meta/common.h> #include <meta/common.h>
#include <meta/errors.h> #include <meta/errors.h>
#include <meta/prefs.h> #include <meta/prefs.h>
#include <meta/meta-cursor-tracker.h>
#include "window-private.h" #include "window-private.h"
#include "window-props.h" #include "window-props.h"
@@ -673,35 +674,19 @@ meta_window_x11_property_notify (MetaWindow *window,
static int static int
query_pressed_buttons (MetaWindow *window) query_pressed_buttons (MetaWindow *window)
{ {
double x, y, query_root_x, query_root_y; ClutterModifierType mods;
Window root, child;
XIButtonState buttons;
XIModifierState mods;
XIGroupState group;
int button = 0; int button = 0;
meta_error_trap_push (window->display); meta_cursor_tracker_get_pointer (window->screen->cursor_tracker,
XIQueryPointer (window->display->xdisplay, NULL, NULL, &mods);
META_VIRTUAL_CORE_POINTER_ID,
window->xwindow,
&root, &child,
&query_root_x, &query_root_y,
&x, &y,
&buttons, &mods, &group);
if (meta_error_trap_pop_with_return (window->display) != Success) if (mods & CLUTTER_BUTTON1_MASK)
goto out;
if (XIMaskIsSet (buttons.mask, Button1))
button |= 1 << 1; button |= 1 << 1;
if (XIMaskIsSet (buttons.mask, Button2)) if (mods & CLUTTER_BUTTON2_MASK)
button |= 1 << 2; button |= 1 << 2;
if (XIMaskIsSet (buttons.mask, Button3)) if (mods & CLUTTER_BUTTON3_MASK)
button |= 1 << 3; button |= 1 << 3;
free (buttons.mask);
out:
return button; return button;
} }

View File

@@ -10343,25 +10343,15 @@ window_focus_on_pointer_rest_callback (gpointer data)
MetaWindow *window = focus_data->window; MetaWindow *window = focus_data->window;
MetaDisplay *display = window->display; MetaDisplay *display = window->display;
MetaScreen *screen = window->screen; MetaScreen *screen = window->screen;
Window root, child; int root_x, root_y;
double root_x, root_y, x, y;
guint32 timestamp; guint32 timestamp;
XIButtonState buttons; ClutterActor *child;
XIModifierState mods;
XIGroupState group;
if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK) if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK)
goto out; goto out;
meta_error_trap_push (display); meta_cursor_tracker_get_pointer (screen->cursor_tracker,
XIQueryPointer (display->xdisplay, &root_x, &root_y, NULL);
META_VIRTUAL_CORE_POINTER_ID,
screen->xroot,
&root, &child,
&root_x, &root_y, &x, &y,
&buttons, &mods, &group);
meta_error_trap_pop (display);
free (buttons.mask);
if (root_x != focus_data->pointer_x || if (root_x != focus_data->pointer_x ||
root_y != focus_data->pointer_y) root_y != focus_data->pointer_y)
@@ -10371,17 +10361,15 @@ window_focus_on_pointer_rest_callback (gpointer data)
return TRUE; return TRUE;
} }
/* Explicitly check for the overlay window, as get_focus_window_at_point() child = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (clutter_stage_get_default ()),
* may return windows that extend underneath the chrome (like CLUTTER_PICK_REACTIVE, root_x, root_y);
* override-redirect or DESKTOP windows) if (!META_IS_SURFACE_ACTOR (child))
*/
if (child == meta_get_overlay_window (screen))
goto out; goto out;
window = window =
meta_stack_get_default_focus_window_at_point (screen->stack, meta_stack_get_default_focus_window_at_point (screen->stack,
screen->active_workspace, screen->active_workspace,
None, root_x, root_y); NULL, root_x, root_y);
if (window == NULL) if (window == NULL)
goto out; goto out;

View File

@@ -44,8 +44,6 @@
static void meta_frames_destroy (GtkWidget *object); static void meta_frames_destroy (GtkWidget *object);
static void meta_frames_finalize (GObject *object); static void meta_frames_finalize (GObject *object);
static void meta_frames_style_updated (GtkWidget *widget); static void meta_frames_style_updated (GtkWidget *widget);
static void meta_frames_map (GtkWidget *widget);
static void meta_frames_unmap (GtkWidget *widget);
static void meta_frames_update_prelit_control (MetaFrames *frames, static void meta_frames_update_prelit_control (MetaFrames *frames,
MetaUIFrame *frame, MetaUIFrame *frame,
@@ -134,9 +132,6 @@ meta_frames_class_init (MetaFramesClass *class)
widget_class->style_updated = meta_frames_style_updated; widget_class->style_updated = meta_frames_style_updated;
widget_class->map = meta_frames_map;
widget_class->unmap = meta_frames_unmap;
widget_class->draw = meta_frames_draw; widget_class->draw = meta_frames_draw;
widget_class->destroy_event = meta_frames_destroy_event; widget_class->destroy_event = meta_frames_destroy_event;
widget_class->button_press_event = meta_frames_button_press_event; widget_class->button_press_event = meta_frames_button_press_event;
@@ -231,6 +226,7 @@ meta_frames_init (MetaFrames *frames)
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal, frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref); g_free, g_object_unref);
update_style_contexts (frames); update_style_contexts (frames);
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE); gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
@@ -522,13 +518,26 @@ MetaFrames*
meta_frames_new (int screen_number) meta_frames_new (int screen_number)
{ {
GdkScreen *screen; GdkScreen *screen;
MetaFrames *frames;
screen = gdk_display_get_screen (gdk_display_get_default (), screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number); screen_number);
return g_object_new (META_TYPE_FRAMES, frames = g_object_new (META_TYPE_FRAMES,
"screen", screen, "screen", screen,
NULL); "type", GTK_WINDOW_POPUP,
NULL);
/* Put the window at an arbitrary offscreen location; the one place
* it can't be is at -100x-100, since the meta_window_new() will
* mistake it for a window created via meta_create_offscreen_window()
* and ignore it, and we need this window to get frame-synchronization
* messages so that GTK+'s style change handling works.
*/
gtk_window_move (GTK_WINDOW (frames), -200, -200);
gtk_window_resize (GTK_WINDOW (frames), 1, 1);
return frames;
} }
/* In order to use a style with a window it has to be attached to that /* In order to use a style with a window it has to be attached to that
@@ -635,22 +644,6 @@ meta_frames_unmanage_window (MetaFrames *frames,
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow); meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
} }
static void
meta_frames_map (GtkWidget *widget)
{
/* We override the parent map function to a no-op because we don't
* want to actually show the GDK window. But GTK needs to think that
* the widget is mapped or it won't deliver the events we care about.
*/
gtk_widget_set_mapped (widget, TRUE);
}
static void
meta_frames_unmap (GtkWidget *widget)
{
gtk_widget_set_mapped (widget, FALSE);
}
static MetaUIFrame* static MetaUIFrame*
meta_frames_lookup_window (MetaFrames *frames, meta_frames_lookup_window (MetaFrames *frames,
Window xwindow) Window xwindow)

View File

@@ -295,9 +295,12 @@ meta_ui_new (Display *xdisplay,
g_assert (gdisplay == gdk_display_get_default ()); g_assert (gdisplay == gdk_display_get_default ());
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen)); ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
/* This does not actually show any widget. MetaFrames has been hacked so /* GTK+ needs the frame-sync protocol to work in order to properly
* that showing it doesn't actually do anything. But we need the flags * handle style changes. This means that the dummy widget we create
* set for GTK to deliver events properly. */ * to get the style for title bars actually needs to be mapped
* and fully tracked as a MetaWindow. Horrible, but mostly harmless -
* the window is a 1x1 overide redirect window positioned offscreen.
*/
gtk_widget_show (GTK_WIDGET (ui->frames)); gtk_widget_show (GTK_WIDGET (ui->frames));
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui); g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui);