Commit Graph

4040 Commits

Author SHA1 Message Date
Jasper St. Pierre
75de29f5f7 errors: Remove vestigals of old error trap implementation 2014-04-07 10:37:03 -04:00
Jasper St. Pierre
e2b24092d6 events: Don't pass any X input events on to Clutter / GTK+ 2014-04-07 10:37:02 -04:00
Jasper St. Pierre
0e6570b09b events: Early exit when we get a SN notification event
Nothing else needs to see this.
2014-04-07 10:37:02 -04:00
Jasper St. Pierre
840378ae68 xprop: Don't use GDK for reading text properties 2014-04-07 10:37:02 -04:00
Jasper St. Pierre
4752776ebf ui: Don't add our filter function twice 2014-04-06 15:19:04 -04:00
Jasper St. Pierre
c40868b239 xwayland: Fix rendering
Since we get the ClientMessage after the surface is created, there's
no good way to synchronize the two streams. In this case, what we
need to do is delay the surface commit until after we get the
ClientMessage. Ideally, we'd be using a better surface system overall
where committing the surface didn't depend on what type it is, but
oh well, this is a good short-term hack for now.
2014-04-02 13:24:58 -04:00
Jasper St. Pierre
a21e7a2188 wayland: Move surface_set_buffer back into the commits
For XWayland support, we need to delay the buffer set until after
we do the typechecking, as we need to bail out early in that case.
2014-04-02 13:24:58 -04:00
Jasper St. Pierre
371fba6843 wayland: Move the commit implementation to the top
We're going to need to expose commit as a public method for XWayland
support, so decouple it from the handler implementation.
2014-04-02 13:24:57 -04:00
Jasper St. Pierre
be02fa1120 xwayland: Switch to the new Xwayland DDX 2014-04-02 13:24:57 -04:00
Jasper St. Pierre
43730f1660 xwayland: Switch to SIGUSR1 to know when the X server has finished init
This is effectively the same, but since we lose the xserver.xml protocol
in the new XWayland DDX, we have to use SIGUSR1 anyway, so might as well
switch over now.
2014-04-02 13:16:10 -04:00
Jasper St. Pierre
4f609dbf5e xwayland: Don't use glib after forking
glib doesn't have any guarantee about working after forking.
We can get away with it, but we're better off just not using it.
2014-04-02 13:04:31 -04:00
Jasper St. Pierre
2a7d12ba14 xwayland: Make failing to exec a fatal error 2014-04-02 13:03:29 -04:00
Jasper St. Pierre
c4c0b5f0ab xwayland: Detect a fail to fork 2014-04-02 13:03:17 -04:00
Jasper St. Pierre
8373c90cd8 background: Remove load_still_frame
Nothing uses it, and it's incompatible with XWayland anyway.
2014-04-02 12:35:24 -04:00
Jasper St. Pierre
eb5b54dd8b xwayland: Split another part of the initialization sequence out
This will be used from a SIGUSR1 handler.
2014-04-02 11:41:28 -04:00
Jasper St. Pierre
9653b79a35 xwayland: Split a helper out
This will make the next commit, which ports to the new ClientMessage
API, more understandable.
2014-04-02 11:41:28 -04:00
Jasper St. Pierre
e07bd15fc2 xwayland: Make file cosmetically modern
Put a modeline, include "config.h", and shift around the include ordering
2014-04-02 11:41:27 -04:00
Jasper St. Pierre
5cf0740b4e xwayland: Fork the X server ourselves
gspawn just isn't us the fine-grained control we need for starting
processes and leaking file descriptors in.
2014-04-02 11:41:27 -04:00
Jasper St. Pierre
c540ddf59b xwayland: Move display_name into choose_xdisplay 2014-04-02 11:41:27 -04:00
Jasper St. Pierre
a44295599c xwayland: Split out the code that creates the XWayland sockets 2014-04-02 11:41:26 -04:00
Jasper St. Pierre
af272f2685 xwayland: Move global initialization down 2014-04-02 11:41:26 -04:00
Jasper St. Pierre
81d033ec73 xwayland: Use %m instead of manual strerror(errno) 2014-04-02 11:41:26 -04:00
Jasper St. Pierre
e9ee984921 wayland: Rename the wl_surface interface handlers
We usually name the method handlers after the direct name
of the interface methods. Do that for wl_surface as well.
2014-04-02 11:41:26 -04:00
Jasper St. Pierre
3c404c5db3 wayland: Replace make_toplevel / window_unmanaging with set_window
The make_toplevel / window_unmanaging interface has never made
a lot of sense to me. Replace it with set_window, which does
effectively the same thing.

It's still not perfect in the case of XWayland, but I don't think
XWayland will ever make me happy.
2014-04-02 11:41:07 -04:00
Jasper St. Pierre
e4cd000cef wayland: Implement wl_seat v3
The new XWayland DDX flat out requires seat v3.
2014-04-02 11:40:40 -04:00
Jasper St. Pierre
6296fefea6 window-actor: Clean up has_shadow
This has some particularly picky #if 0'd code. Since the history for
it isn't illuminating in the slightest, I'm just going to kill it.
2014-04-02 11:40:04 -04:00
Jasper St. Pierre
c1e3a6b742 idle-monitor: Actually get the check for is_wayland_compositor correctly
If we're a Wayland compositor we shouldn't be taking this path, ever.
2014-04-01 16:05:53 -04:00
Jasper St. Pierre
dcd83b7365 idle-monitor-native: Remove another copy/paste error
Don't overwrite the watch with a new malloc'd variable.
2014-04-01 16:01:06 -04:00
Jasper St. Pierre
617b00dfbd idle-monitor-native: Reindent 2014-04-01 15:52:11 -04:00
Jasper St. Pierre
94692414cb idle-monitor-native: Fix copy/paste bug 2014-04-01 15:52:11 -04:00
Jasper St. Pierre
ab6bc76bfd Move edid-parse to backends/ 2014-04-01 14:35:04 -04:00
Jasper St. Pierre
57803f1d59 wayland-stage: Clean up and rename
It should be META_TYPE_WAYLAND_STAGE, not META_WAYLAND_TYPE_STAGE.

Well, actually, it *should* be META_TYPE_NATIVE_STAGE, because it's
not related to Wayland at all. But that comes later :)
2014-04-01 14:04:58 -04:00
Jasper St. Pierre
67b6737b27 backend: Fix warning 2014-04-01 14:04:53 -04:00
Jasper St. Pierre
29396014fd backend: Fix the nested mode 2014-04-01 13:56:40 -04:00
Jasper St. Pierre
899d4d8477 monitor-manager: Move default get_edid_file / read_edid to base class
These are also used by the native manager.
2014-04-01 10:24:34 -04:00
Jasper St. Pierre
bce1d5117b Start creating different subdirectories for each backend 2014-03-31 23:44:47 -04:00
Jasper St. Pierre
d5552cc372 Rename meta-xrandr-shared to meta-display-config-shared 2014-03-31 23:44:47 -04:00
Jasper St. Pierre
fd392cc1e7 Remove "xrandr" from the name of the generated DBus files
It's about generic display config, not XRandR specifically.
2014-03-31 23:44:47 -04:00
Jasper St. Pierre
b641d9d5a8 Rename the DBus interface files 2014-03-31 23:44:46 -04:00
Jasper St. Pierre
5bcc78498f Move MetaLauncher to meta-backend 2014-03-31 23:44:46 -04:00
Jasper St. Pierre
521125b672 meta-wayland: Use meta_clutter_init 2014-03-31 23:44:45 -04:00
Jasper St. Pierre
89b931435d Move meta_clutter_init into a new file
We'll use this to get the initialization between the Wayland and
X11 compositor codepaths back in sync.
2014-03-31 23:44:25 -04:00
Jasper St. Pierre
e22e9f5df5 main: Refactor some code slightly 2014-03-31 22:55:13 -04:00
Jasper St. Pierre
20547e3b63 Move weston-launch to backends/
It's about display servers, not Wayland integration.
2014-03-31 22:48:34 -04:00
Jasper St. Pierre
2cf185b4e4 Move mutter-Xatomtype to x11/ 2014-03-31 22:13:12 -04:00
Jasper St. Pierre
229360b248 Start molding out a new src/backends/ dir
Right now this just has all of the files in one directory. We'll
be introducing more structure to this in the future, and build
a proper backend system.
2014-03-31 22:11:00 -04:00
Jasper St. Pierre
ccced506ed Rename monitor => meta-monitor-manager 2014-03-31 22:05:24 -04:00
Jasper St. Pierre
28b9160c01 Rename monitor-config => meta-monitor-config 2014-03-31 22:05:22 -04:00
Jasper St. Pierre
ba6584a0d7 Move monitor-config to its own header file 2014-03-31 22:04:38 -04:00
Jasper St. Pierre
2a0289a216 Move the dummy monitor manager to his own subclass / file 2014-03-31 21:52:32 -04:00
Jasper St. Pierre
f6a73bcf22 cursor: Do less work if we don't have a connection to GBM at all 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
59e064f610 cursor: Split out code that loads an image into a GBM buffer 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
ba131626c2 cursor: Always use cogl_wayland_texture_2d_new_from_buffer
It makes our life so much easier.
2014-03-31 19:14:56 -04:00
Jasper St. Pierre
30ebf46aa4 cursor: Reindent 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
da27735265 cursor: Refactor code to load cursor images out
We're going to make MetaCursorReference specialized and per-backend soon.
2014-03-31 19:14:55 -04:00
Jasper St. Pierre
78dbf8cb56 cursor: Split out the structure for the actual textures / buffers out
This will allow us to have a MetaCursorReference 'subclass' that's
lazily loaded. We currently always load all the images.

The long-term plan is to have a subclass for each "backend" and only
have CoglTexture as a common denominator. For the nested X11 backend,
we use XDefineCursor on our stage window. For the Wayland backend, we
would use set_cursor on our stage surface. For the native backend, we
would use the GBM code that's there right now.

The CoglTexture is there to be a "shared fallback" between all devices,
and also for the get_sprite API.

The odd man out is the X11 compositor case. For that, we need to move
the responsibility of setting the final cursor image out of
MetaCursorTracker, and simply have it be about tracking the used sprite
image and pointer position.
2014-03-31 19:09:08 -04:00
Jasper St. Pierre
f4e299ca46 cursor: Split out code that frees the MetaCursorReference 2014-03-31 18:27:20 -04:00
Jasper St. Pierre
f95f2b0c6d cursor-tracker: Make set_root_cursor take a MetaCursorReference 2014-03-31 18:27:20 -04:00
Jasper St. Pierre
fe42a4eb4e screen: Move XDefineCursor on the root window here
This is really an X11 front-end thing, so it doesn't belong in the
cursor tracker, which is a back-end thing.
2014-03-31 18:27:20 -04:00
Jasper St. Pierre
565883dadb screen: Refactor update_cursor a bit 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
be60e4f6e7 cursor-tracker: Make set_window_cursor take a MetaCursorReference as well 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
fa60824096 cursor-tracker: Make set_grab_cursor take a MetaCursorReference 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
0efb0b47eb cursor: Move cursor caching layer to meta_cursor_reference_from_theme 2014-03-31 18:27:18 -04:00
Jasper St. Pierre
0f810a4e21 cursor: Refactor out code that loads from XcursorImage 2014-03-31 18:27:18 -04:00
Jasper St. Pierre
383d4c7e4e cursor: Introduce accessors for the texture / GBM bo
We want to make this private, and have MetaCursorReference be
backend-defined, with the texture possibly loaded on demand.

We can't make the definition of MetaCursorReference truly private yet
because of the XFixes cursor. A victim of MetaCursorTracker trying to
do too many things at once...
2014-03-31 18:27:18 -04:00
Jasper St. Pierre
21425b5833 cursor-tracker: Split the code that loads MetaCursorReferences out
The plan here is to move the usage of these interfaces to the consumer,
and then slam the code into backends.
2014-03-31 18:27:18 -04:00
Jasper St. Pierre
863569b702 cursor-tracker: Split out the code that updates the new cursor 2014-03-31 18:27:17 -04:00
Jasper St. Pierre
5f52f55916 cursor-tracker: Start moving some code to a new file
I want the MetaCursorTracker to mostly be about retrieving cursor
information. Start moving the code that loads cursor images to a
new file, MetaCursor. Eventually, MetaCursorTracker's APIs will
all take MetaCursorReferences, and we can have a clean backend
split here.
2014-03-31 18:27:17 -04:00
Jasper St. Pierre
0aec98cf02 idle-monitor: Hack out assert fail
It seems that we're getting XSyncAlarmNotify events here as a Wayland
compositor for some reason. Just hack this one out for now.
2014-03-31 18:27:17 -04:00
Jasper St. Pierre
b64d14ff4a cursor-tracker: Rearrange code
Move take_texture closer to where it's used, and add hot_x / hot_y args.
2014-03-31 15:22:31 -04:00
Jasper St. Pierre
08a8254deb cursor-tracker: Move ref_count to the top 2014-03-31 15:22:31 -04:00
Jasper St. Pierre
11de01741c cursor-tracker: Add a comment about what previous is
It confused me a bit.
2014-03-31 15:22:31 -04:00
Jasper St. Pierre
a7ea2cd365 cursor-tracker: Shadowing is bad, don't do it 2014-03-31 15:22:31 -04:00
Jasper St. Pierre
a15a4faff0 cursor-tracker: Remove unused constants 2014-03-31 15:22:30 -04:00
Jasper St. Pierre
b93176d89a cursor-tracker: Kill off an unused include 2014-03-30 23:06:01 -04:00
Jasper St. Pierre
f842ea6d15 idle-monitor: Make the rest of the implementation-specific fields private 2014-03-30 23:04:39 -04:00
Jasper St. Pierre
422f2e5fe6 idle-monitor: Kill off an unused field 2014-03-30 23:00:10 -04:00
Jasper St. Pierre
3961f291e4 idle-monitor: Move the alarms field to the XSync backend
For whatever reason, this hash table was in the generic
implementation section instead of the XSync implementation,
even though it's only used by the XSync implementation.

Use it as a first pass of things to move over.
2014-03-30 22:55:54 -04:00
Jasper St. Pierre
61d8b35254 idle-monitor: Move watch implementations to be private to the subclass 2014-03-30 22:55:03 -04:00
Jasper St. Pierre
78457cf7b4 idle-monitor: Create separate subtypes for backend-specific idle monitors
The separation here isn't 100% clean yet, as there's common
parts that are still protocol specific. We'll clean that up
in the next commit.
2014-03-30 22:55:03 -04:00
Jasper St. Pierre
1e2bdcc3c5 idle-monitor: Move reset_idletime handling to events.c
It's not specific to the Wayland protocol at all, and it's not really
a Wayland compositor thing. This should eventually be in the native
backend.
2014-03-30 22:55:02 -04:00
Jasper St. Pierre
490e1c8c3b idle-monitor: Split the DBus implementation to a separate file 2014-03-30 22:55:02 -04:00
Jasper St. Pierre
9a751a95e3 idle-monitor: Rearrange code to make it a cleaner split
We're going to push this to be subclasses soon.
2014-03-30 22:55:02 -04:00
Jasper St. Pierre
afce448281 Kill meta_ui_add_event_func / remove_event_func
The reason we don't simply use gdk_window_add_filter directly is
because of some twisted idea that any GDK symbol being used from
core/ is a layer violation. While we certainly want to keep any
serious GDK code out of ui/, event handling is quite important
to have in core/, so simply use a GDK event filter directly.
2014-03-30 22:55:01 -04:00
Jasper St. Pierre
b2405b701a Move monitor manager headers to their own files
Instead of having them in monitor-private.h.

This way, it's easier to move our own backend when the chance arises.
2014-03-30 22:54:52 -04:00
Jasper St. Pierre
390c028da7 Rename the monitor backend filenames
To match the "meta-*" new-style naming.
2014-03-30 20:21:39 -04:00
Jasper St. Pierre
82e02e39d3 window-actor: Fix the input shape region for decorated X11 windows
The code here before was completely wrong. Not only did it mix up
coordinate spaces of "client rect" vs. "frame rect", but it used
meta_frame_get_frame_bounds, which is specifically for the *visible*
bounds of a window!

In the case that we don't have a bounding or input shape region at
all on the client window, the input shape that we should apply is
the surface's natural shape. So, set the region to NULL to get the
natural rect picking semantics.
2014-03-30 20:16:58 -04:00
Jasper St. Pierre
0f9b29b140 display: Don't double-free the screen
We already free the screen once in meta_display_close.

This fixes a crash when trying to restart mutter.
2014-03-28 13:58:50 -04:00
Jasper St. Pierre
b367965f6c window: Track known_to_compositor and visible_to_compositor separately
Really, visible_to_compositor means that the window is shown, e.g.
not minimized. We need to be using a boolean tracking whether we've
called meta_compositor_add_window / meta_compositor_remove_window.

This fixes a jump during window placement when a window appears.
2014-03-28 13:52:59 -04:00
Jasper St. Pierre
ed9dbf6aa2 window: Ensure that visible_to_compositor is set when unmanaging
visible_to_compositor should always be in sync with show_window /
hide_window calls, even when unmananging.

This fixes a crash where we call sync_window_state when the window
is unmanaging, since we use visible_to_compositor to determine whether
the compositor will crash.

This is actually wrong; we should be using the knowledge about
whether we have called add_window / remove_window. We'll introduce
this with a new boolean next time.
2014-03-28 13:51:34 -04:00
Jasper St. Pierre
e10fd19d24 events: Make sure to check the event window of the MapNotify
This was lost in a rebase when killing off zaphod mode.
2014-03-28 13:46:46 -04:00
Matthias Clasen
f4f529385a Fix the build with -Werror=maybe-uninitialized
gcc can't really know that the condition won't change between
the first if and the second, so help it out by initializing
the variable up top.
2014-03-27 14:58:20 -04:00
Jasper St. Pierre
3f70bdd331 display: Revert API break for get_tab_list
gnome-shell apparently uses this, and we shouldn't break it.
2014-03-27 12:48:05 -04:00
Adel Gadllah
6eeaf09ab7 compositor: Don't call process_damage if the window is gone
We might get a damage event for an already unmanaged window calling
process_damage is pointless and causes a crash so simply skip that case.

https://bugzilla.gnome.org/show_bug.cgi?id=727115
2014-03-27 14:06:27 +01:00
Jasper St. Pierre
f93fa1d705 window-actor: Don't queue a redraw when queueing a new pixmap
We guarantee ourselves that a valid pixmap will appear any time
that the window is painted. The window actor will be scheduled
for a repaint if it's added / removed from the scene graph, like
during construction, if the size changes, or if we receive damage,
which are the existing use cases where this function is called.

So, I can't see any reason that we queue a redraw in here.

With the split into surface actors, we don't have an easy place
we can use to queue a redraw, and since it's unnecessary, we can
just drop it on the floor.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-03-26 17:30:46 -04:00
Jasper St. Pierre
cd905a34fb compositor: Kill off MetaCompScreen
Compositors haven't been able to manage more than one screen for
quite a while. Merge MetaCompScreen into MetaCompositor, and update
the API to match.

We still keep MetaScreen in the public compositor API for compatibility
purposes.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
47aa583625 display: Kill off grab_screen
Just like active_screen, the screen can always be inferred
from the MetaDisplay, so there's no point in keeping it around.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
d7519f4ebc Remove any possibility for zaphod mode
We previously separated out MetaDisplay and MetaScreen. mutter
would only manage one screen, but we still kept a list of screens
for simplicity.

With Wayland support, we no longer care about the ability to
manage more than one screen at a time. Remove this by killing
the list of screens, in favor of having just one MetaScreen
in MetaDisplay.

We also kill off active_screen at the same time, since it's
not necessary anymore.

A future cleanup should merge MetaDisplay and MetaScreen. To avoid
breaking API, we should probably keep MetaScreen around as a dummy
type.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
97ea4e8717 xwayland: Remove some stray logs
These really aren't too helpful.
2014-03-26 12:04:14 -04:00
Jasper St. Pierre
208296a619 wayland: Shut up about Setenv if we're past initialization
I'm a bit tired of hearing about this when I launch mutter-wayland
nested. Ideally, this would be part of display server integration,
not GNOME integration, so we could simply not make the call when
nested, but oh well.
2014-03-26 12:02:08 -04:00
Jasper St. Pierre
cc0488f1e2 surface-actor: Implement is_argb32 generically for both X11 and Wayland
cogl_texture_get_components can be used on both X11 and Wayland
backends. Technically, the detection is different: we actually
check the actual RENDER format in the old code, while Cogl simply
assumes that any pixmap with a depth >= 32 is ARGB32. Since Cogl
already seems to be working with its internal checks, it makes
more sense to  use Cogl's check rather than keeping our own.
2014-03-25 17:04:39 -04:00
Jasper St. Pierre
e30ed6892c surface-actor: Prevent a dumb crash
is_argb32 can be called at any time, including times when we don't
have a texture. In that case, just assume we're ARGB32. The value
really shouldn't be important though.
2014-03-25 17:04:37 -04:00
Jasper St. Pierre
d699b2409a xwayland: Shut up conditionally 2014-03-25 12:54:13 -04:00
Jasper St. Pierre
ef65848d11 window-wayland: Implement kill 2014-03-25 12:05:21 -04:00
Jasper St. Pierre
272676b896 surface-actor-wayland: Make sure to clean up on dispose
We need to remove our destroy handler if the surface is destroyed
before the buffer is, which is the case when we have no destroy
effect.
2014-03-25 12:00:38 -04:00
Jasper St. Pierre
44580ddb80 wayland-surface: Unref the buffer after removing the destroy listener 2014-03-25 12:00:38 -04:00
Jasper St. Pierre
456e3e2429 xwayland: Punt stdout / stderr to /dev/null
This should really go to the journal, but I'm tired of seeing Xorg
log a bunch of garbage that I don't care about when debugging mutter.
2014-03-25 12:00:38 -04:00
Florian Müllner
71be7e8493 display: Fix compiler warning
Don't leave a variable uninitialized in case we don't find a matching
surface.
2014-03-25 16:32:22 +01:00
Rui Matos
7484d540cd wayland: Use an array initializer for the X server arguments
This fixes the unitialized array members introduced previously and
should avoid such mistakes again going forward.

https://bugzilla.gnome.org/show_bug.cgi?id=727011
2014-03-25 14:52:57 +01:00
Ray Strode
a55622d924 wayland: drop -logfile argument
It breaks testing wayland with setuid X server.
2014-03-24 14:18:49 -04:00
Jasper St. Pierre
1cfaf45389 surface-actor-wayland: Fix meta_surface_actor_wayland_is_argb32
This prevents us from clipping shadows under windows for all
apps, and loads of other fun optimizations.
2014-03-20 18:03:38 -04:00
Jasper St. Pierre
42491f7724 window: Actually interpret the FRAME_SHAPE_CHANGED result
When I refactored this out into a vfunc, I forgot to change the
code that interprets the result flags to actually respect the
new FRAME_SHAPE_CHANGED result flag.

Since we weren't ever clearing the frame bounds, this meant that
the "shadow clip" wasn't ever updated as a result. Since right now
all Wayland surfaces are considered ARGB32, we always clip shadows
under frames, and thus shadows had this weird "punch-out" from the
first frame shape.
2014-03-20 18:03:35 -04:00
Jasper St. Pierre
9696e785da screen: Remove flash_window
It's unused as well
2014-03-20 16:48:15 -04:00
Jasper St. Pierre
0de83ebfb5 display: Remove get_leader_window
It's unused.
2014-03-20 16:46:21 -04:00
Jasper St. Pierre
337db2a660 window: Kill off the rest of colormaps
I removed the XInstallColormap / XUninstallColormap but forgot
to remove the fields in MetaWindow and the code to set them.
2014-03-20 16:27:22 -04:00
Jasper St. Pierre
054c307353 window: Remove support for colormaps
While the ICCCM mandates the use of this, it's not necessary under
a composited environment from my understanding, and it's a flat
out no-op under XWayland.

Looking at the other rootless servers like Xwin/Xquartz, it seems
that they contain code for colormap emulation, but they're actually
never used -- a bug prevents the code from ever being called. Given
that it's been this way since 2003, I'm going to hazard a guess that
not many apps using colormaps. Kill them off.
2014-03-20 16:25:09 -04:00
Jasper St. Pierre
852589897e Move send_icccm_message to window-x11 2014-03-20 16:22:15 -04:00
Jasper St. Pierre
46b4d6c0f0 Move request_take_focus to window-x11
This will let us kill off send_icccm_message
2014-03-20 16:06:24 -04:00
Jasper St. Pierre
ab2224686a events: Clean up trailing whitespace 2014-03-20 15:54:16 -04:00
Jasper St. Pierre
24b08d1a36 Move event handling to a new file
display.c is getting a bit crowded. Move most of the handling
out to another file, events.c.

The long-term goal is to have generic event handling here, with
backend-specific handling for the types of windows and such.
2014-03-20 15:46:32 -04:00
Jasper St. Pierre
0808adefaf Move focus to be a vfunc 2014-03-20 15:20:15 -04:00
Jasper St. Pierre
14f424cd02 Move ping to be a vfunc 2014-03-20 15:20:15 -04:00
Jasper St. Pierre
9debd2fb0d Move delete / kill to be a vfunc 2014-03-20 15:07:44 -04:00
Jasper St. Pierre
57359da9b4 wayland: Kill the buffer destroy error
Previously, a sequence like this would crash a client:

  => surface.attach(buffer)
  => buffer.destroy()

The correct behavior is to wait until we release the buffer before
destroying it.

  => surface.attach(buffer)
  => surface.attach(buffer2)
  <= buffer.release()
  => buffer.destroy()

The protocol upstream says that "the surface contents are undefined"
in a case like this. Personally, I think that this is broken behavior
and no client should ever do it, so I explicitly killed any client
that tried to do this.

But unfortunately, as we're all well aware, XWayland does this.
Rather than wait for XWayland to be fixed, let's just allow this.

Technically, since we always copy SHM buffers into GL textures, we
could release the buffer as soon as the Cogl texture is made.

Since we do this copy, the semantics we apply are that the texture is
"frozen" in time until another newer buffer is attached. For simple
clients that simply abort on exit and don't wait for the buffer event
anyhow, this has the added bonus that we'll get nice destroy animations.
2014-03-20 13:53:05 -04:00
Jasper St. Pierre
e67abdd3ff compositor: Kill unused variable 2014-03-20 13:18:55 -04:00
Jasper St. Pierre
ca4777f778 compositor: Make code a bit more understandable 2014-03-20 13:18:47 -04:00
Rui Matos
76dc0ca681 wayland: Exempt CLICKING grab ops when syncing wayland input focus
If we have a CLICKING grab op we still need to send events to xwayland
so that we get them back for gtk+ to process thus we can't steer
wayland input focus away from it.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Rui Matos
8968501031 wayland-seat: Don't send pointer enter/leave events during a GRAB_OP
meta_wayland_seat_repick() can be called in various cases while mutter
has a GRAB_OP ongoing which means we could be sending wrong pointer
enter/leave events.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Rui Matos
1b29113150 wayland: Set/unset wayland focus on mutter grab/ungrab operations
This ensures that we send the proper leave and enter events to wayland
clients.

Particularly, this solves a bug in SSD xwayland windows where clicking
and dragging on the title bar to move the window only works on the odd
turn (unless the pointer moves away from the title bar between
tries). This happens because xwayland gets a button press but doesn't
see the release so when it gets the next button press it discards it
because its pointer button tracking logic says that the button is
already pressed. Sending the proper wayland pointer leave event fixes
it since wayland clients must forget about button state at that point.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Jasper St. Pierre
15c59f9919 keybindings: Split out check for filter_keybinding
This is a small code cleanup for clarity.
2014-03-20 11:03:54 -04:00
Jasper St. Pierre
a53e094fcd window: Move move_resize_internal logic to protocol-specific directories 2014-03-20 11:02:50 -04:00
Jasper St. Pierre
a377a1a110 window: Move client-type-specific managing / unmanaging to a vfunc 2014-03-20 10:51:32 -04:00
Jasper St. Pierre
74a1e00e30 window: MetaWindow is now abstract 2014-03-20 10:50:27 -04:00
Jasper St. Pierre
1c41f71eef window: Add a type for Wayland windows 2014-03-20 10:50:27 -04:00
Jasper St. Pierre
63350c52cc window: Remove code for static gravity resizes
It was never turned on for all the years it's been there.
2014-03-20 10:50:27 -04:00
Jasper St. Pierre
a1427c7130 Revert "Move MetaGroup to be X11-specific"
This reverts commit f940292cfe.

Turns out MetaGroup was public API and was used by gnome-shell.
Ugh.
2014-03-19 09:12:48 -04:00
Jasper St. Pierre
f0c7b518e6 Don't generate sources in a subdirectory
This fixes srcdir != builddir issues.
2014-03-18 22:06:31 -04:00
Jasper St. Pierre
5fa5ace5e6 Move session to x11/
XSMP code is X11-specific, of course.
2014-03-18 22:04:36 -04:00
Jasper St. Pierre
044c06bff3 Don't include wayland/ by default either 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
a3ccc4fd1c Remove x11/ directory from default include path 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
0a20f7458c window: Remove support for _NET_WM_ICON_NAME
We don't seem to use it anywhere.
2014-03-18 22:04:36 -04:00
Jasper St. Pierre
9c94f8ae47 Move testasyncgetprop.c to x11/ 2014-03-18 22:04:27 -04:00
Jasper St. Pierre
f940292cfe Move MetaGroup to be X11-specific 2014-03-18 21:23:36 -04:00
Jasper St. Pierre
48a36356dd window: Make window->desc a bit clearer
And remove the hack for the "broken GNU libc". It works fine on
my system here.
2014-03-18 21:23:34 -04:00
Jasper St. Pierre
f05983be42 window: Move type_atom to window-x11 2014-03-18 21:15:49 -04:00
Jasper St. Pierre
dfcefd3315 Remove meta_core_increment_event_serial
It's unused.
2014-03-18 21:12:37 -04:00
Jasper St. Pierre
3fe755e684 display: Fix a typo 2014-03-18 21:12:37 -04:00
Jasper St. Pierre
0eb86de807 Move Wayland protocols into src/wayland 2014-03-18 20:37:35 -04:00
Jasper St. Pierre
ff635bad3b Clean up the source tree
Remove a lot of old, unmaintained files
2014-03-18 20:37:35 -04:00
Jasper St. Pierre
43a409dec4 window: Don't sync window geometry when we haven't shown it yet 2014-03-18 18:55:32 -04:00
Jasper St. Pierre
b087fce062 window-actor: Also always assume the plugin manager exists
Addendum to the above...
2014-03-18 18:31:07 -04:00
Jasper St. Pierre
420f322910 compositor: Assume the plugin manager always exists 2014-03-18 18:25:33 -04:00
Jasper St. Pierre
4bf6e0ae8c compositor: Kill off an unused cursor variable 2014-03-18 18:25:33 -04:00
Jasper St. Pierre
97872e70a5 compositor: Fix variable name style in meta_shape_cow_for_window
This has bugged me forever...
2014-03-18 18:25:33 -04:00
Jasper St. Pierre
be57308663 compositor: Clean up
Remove a bunch of weird checks, random logs, unused variables
and other cruft that nobody cares about today.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
33f1bd96f5 compositor: Kill off modal_plugin
We only ever have one plugin, so don't bother recording which plugin
is modal, only whether we are modal or not.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
9ba49358e5 compositor: Remove meta_check_end_modal
"This is used when reloading plugins"

Yeah, no.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
8b2b65246a Assume the compositor always exists
At one point, it was supported to run mutter without a compositor,
but we don't allow that any longer. A lot of code already assumes
display->compositor exists and doesn't check for a NULL pointer,
so just kill the rest of the checks.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
4fdbb466e1 meta-plugin: Remove some unused features
And don't use properties for no reason.
2014-03-18 18:25:31 -04:00
Jasper St. Pierre
da48b18188 window: Fix build
A bad rebase on top of some other GObject cleanups I had made
this go sour.
2014-03-18 16:45:53 -04:00
Jasper St. Pierre
a5f1790828 window: Rename wm_hints_urgent to urgent
The flag and setter is now decoupled from the WM_HINTS state.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
6efcf2526d window: Move urgency to a setter 2014-03-18 15:44:11 -04:00
Jasper St. Pierre
d6a27195d3 Move more fields to MetaWindowX11 2014-03-18 15:44:11 -04:00
Jasper St. Pierre
8f151842fb Start moving X11 implementation to its own subdirectory
This is specifically about managing X11 windows, not necessarily
running as an X11 compositor. By that I mean that this code is
still used for XWayland windows, and event handling is still and
modesetting / monitor management is still in core/.

This is also a fairly conservative move. We don't move anything
like screen.c or bell.c in here, even though those are really
only for X11 clients.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
6f7023bc6b Start splitting the X11-specific stuff of MetaWindow out into a subclass
This is fairly simple and basic for now, with just skip_taskbar /
skip_pager, but eventually a lot of "WM policy" like this, including
move-resize, will be in subclasses for each individual surface.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
63b158e4da window: Split out recalc of skip_taskbar / skip_pager
This will be our first attempt for the MetaWindowX11Private
2014-03-18 15:44:11 -04:00
Rui Matos
b3364cad3e wayland: Update keyboard state unconditionally
In particular we need to know about all key events to keep the xkb
state reliable even if the event is then consumed by a global shortcut
or grab and never reaches any wayland client.

We also need to keep track of all pressed keys at all times so that we
can send an updated set or pressed keys to the focused client when a
grab ends.

https://bugzilla.gnome.org/show_bug.cgi?id=722847
2014-03-18 19:15:17 +01:00
Rui Matos
3502cfba34 wayland-keyboard: Split out a function to determine the evdev keycode
We will need to use this is in another place on the next commit.

https://bugzilla.gnome.org/show_bug.cgi?id=722847
2014-03-18 19:15:17 +01:00
Rui Matos
5cc6becb63 wayland-keyboard: Make sure we send an updated modifiers event
Any given clutter event carries the modifier state as it was before it
occured but, for the wayland modifiers event, we want the state
including the current event.

To fix this, we'll keep our xkb_state instance around instead of the
serialized mods.

https://bugzilla.gnome.org/show_bug.cgi?id=722847
2014-03-18 19:15:17 +01:00
Jasper St. Pierre
ae8f21a3dc wayland-keyboard: Don't use our own tracking to detect autorepeat
Clutter already marks all autorepeat key events it as synthetic
key events. We can simply ignore these instead of relying on custom
key tracking code.
2014-03-18 19:15:17 +01:00
Jasper St. Pierre
3de58189c0 window: Remove an unused bit 2014-03-18 13:18:52 -04:00
Jasper St. Pierre
5270c469a3 window: Remove meta_window_set_gravity as "public" API 2014-03-18 11:24:24 -04:00
Jasper St. Pierre
7504f16e59 Replace wm_state_modal usage with META_WINDOW_TYPE_DIALOG 2014-03-18 11:24:24 -04:00
Jasper St. Pierre
cdb7947dd1 window: Remove meta_window_is_modal
It relies on EWMH concepts. Wayland simply has a MODAL_DIALOG type.
2014-03-18 11:24:24 -04:00
Jasper St. Pierre
cdfc6f5b53 window: Remove vfunc slots for signals
These aren't used currently, and we're going to be adding
more vfuncs.
2014-03-18 11:24:24 -04:00
Jasper St. Pierre
fcb2ab41b2 window: Remove another bogus comment
It's not referring to anything!
2014-03-18 11:24:16 -04:00
Jasper St. Pierre
f5bd7c5f50 window: Remove bogus comment
These fields haven't been around for quite some time.
2014-03-18 11:24:16 -04:00
Jasper St. Pierre
cb549154aa window: Move meta_window_configure_notify to window-x11 2014-03-18 11:24:16 -04:00
Jasper St. Pierre
ada9610e30 Start hacking out use of xtransient_for
It won't work under Wayland.
2014-03-18 10:25:54 -04:00
Jasper St. Pierre
f11bf44525 stack: Flatten and simplify the default focus window logic 2014-03-18 10:25:54 -04:00
Jasper St. Pierre
1f15c85c00 window: Make window_is_terminal private 2014-03-18 10:25:54 -04:00
Jasper St. Pierre
8b4c5459c0 window: Remove transient_for_as_xid
It's unused, and it exposes an X11-specific property to API.
2014-03-18 10:07:07 -04:00
Jasper St. Pierre
d07d5d1328 common: remove documentation for dead grab ops 2014-03-17 16:18:11 -04:00
Jasper St. Pierre
535685742a window: Export is_title_onscreen and shove_title_onscreen as well
This was fixed in the master version of the commit, but I forgot to
squash it on the Wayland branch.
2014-03-17 11:18:26 -04:00
Rui Matos
62e45b6d5e wayland-pointer: Drop unused arg from focus grab interface method
https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-17 11:06:58 +01:00
Jasper St. Pierre
3c6dd5bf6d window: Export a bunch of state flags as accessor methods
This is necessary to reimplement window menus in gnome-shell.
2014-03-15 09:49:56 -04:00
Jasper St. Pierre
0f85986340 Add a META_MAXIMIZE_BOTH
Which has the value of META_MAXIMIZE_VERTICAL |
META_MAXIMIZE_HORIZONTAL.

This is an obvious code cleanup.
2014-03-15 09:49:56 -04:00
Jasper St. Pierre
93ac0329db weston-launch: Fix a typo causing mutter-launch to not work 2014-03-14 16:04:56 -04:00
Jasper St. Pierre
c539dfe0d7 weston-launch: Pass the DRM device to Cogl
Open the device from weston-launch, and pass it to Cogl/Clutter.
This is a preliminary cleanup for our login1 integration.
2014-03-14 14:13:05 -04:00
Jasper St. Pierre
4f9872c037 window: Export a bunch of state flags as accessor methods
This is necessary to reimplement window menus in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=726352
2014-03-14 11:25:55 -04:00
Jasper St. Pierre
24e12053ea window: Add a META_MAXIMIZE_BOTH maximization flag
Which has both directions set. This is a simple cleanup to
remove the constant VERTICAL | HORIZONTAL all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=726352
2014-03-14 11:25:55 -04:00
Jasper St. Pierre
a9d8107c3d window: Replace meta_window_type_changed with meta_window_set_type
Which does the equality checking for us.
2014-03-13 17:14:28 -04:00
Jasper St. Pierre
a5d2c51392 window: Move recalc_type to window-x11.c
It's only used by the X11 codepath.
2014-03-13 17:14:28 -04:00
Carlos Garnacho
991c85f6a0 core: Add minimal handling of touch events
Currently touch events are ignored in the core event handler,
and hence dealt with within GDK. If those touch events were
emulating pointer events, GDK would attempt to convert back
those events to pointer events as the frame GdkWindow doesn't
have the GDK_TOUCH_MASK set.

This results in XI_TouchBegin events being initially processed
by GDK, converted to button events, and triggering a grab op
that subverts touch events into pointer events, so the touch
is never ever seen again by GDK. This leaves GDK in an
inconsistent internal state wrt pointer grabs, so future
pointer-emulating touches will refer to the same window forever.

Fix this by handling touch events minimally, just enough to
convert XI_TouchBegin to GDK_BUTTON_PRESS within mutter, so GDK
is bypassed for every touch event just like it is for pointer
events. This, and the XIGrabDevice() that keeps coercing pointer
events when the grab operation starts, are enough to fix window
drag and drop on touch devices.

https://bugzilla.gnome.org/show_bug.cgi?id=723552
2014-03-13 20:10:07 +01:00
Jasper St. Pierre
d1ea17e6a4 meta-weston-launch: Adapt to Clutter's new evdev open callback 2014-03-13 12:47:11 -04:00
Jasper St. Pierre
b37ad66e9d xdg-shell: Update for new state change mechanism
We're still not properly going through the request system. This
will require a dense investigation of the code, but it will happen
soon...
2014-03-12 23:42:55 -04:00
Matthias Clasen
c1f15348a5 Revert "weston-launch: Pass the DRM device to Cogl"
This reverts commit 857561baed.

This broke the build, and was pushed prematurely.
2014-03-12 14:48:46 -04:00
Jasper St. Pierre
857561baed weston-launch: Pass the DRM device to Cogl
Open the device from weston-launch, and pass it to Cogl/Clutter.
This is a preliminary cleanup for our login1 integration.
2014-03-11 18:01:21 -04:00
Jasper St. Pierre
a44cc9ef47 wayland: Fix build 2014-03-11 18:01:17 -04:00
Jasper St. Pierre
d47b7ba038 Add meta_activate_session
This will be used on startup to switch to the newly activated session.
2014-03-11 17:25:40 -04:00