Commit Graph

5189 Commits

Author SHA1 Message Date
Matthias Clasen
ca09a600c3 wayland: Also emit monitors-changed when monitors are unplugged 2013-03-26 21:53:41 -04:00
Matthias Clasen
27e517a445 wayland: Also emit size-changed when appropriate
We need to be a bit more careful when updating the screen
size - the code that was there would not do the right thing
if e.g. the width of one monitor was reduced.
2013-03-26 21:47:49 -04:00
Matthias Clasen
0489fcffbe wayland: Emit monitors-changed when monitors change 2013-03-26 21:37:21 -04:00
Matthias Clasen
93e5d83a9d Don't decrement the init_ref_count towards -infinity
Once we are at zero, initialization is done.
2013-03-26 21:27:21 -04:00
Kristian Høgsberg
abe7dc6bb4 wayland: Set screen size to bounding box of all outputs
Don't hardcode 8192x8192.  We don't get this info from wayland, so we
compute it as we receive information about the available wl_outputs.

https://bugzilla.gnome.org/show_bug.cgi?id=692871
2013-03-26 17:32:15 -04:00
Kristian Høgsberg
a9e980e578 wayland: Roundtrip until we've receive initial input and output configuration
We use a ref-count mechanism to track whether parts of the init sequence
still needs round trips to receive remaining initial state.  Typically
we need a couple of roundtrips total to get the global list, then the
input and output configurations, but with the ref-count we avoid making
global assumptions like that.

https://bugzilla.gnome.org/show_bug.cgi?id=696340
2013-03-26 14:42:16 -04:00
Matthias Clasen
920ee770ea wayland: Add toolbar settings 2013-03-24 20:21:50 -04:00
Jan Arne Petersen
8d884bb4fb wayland: Add support for custom surfaces
Allow to set a GdkWindow to use a custom surface instead of a
wl_shell_surface. It allows to register the surface as a custom type
with some Wayland interface.

https://bugzilla.gnome.org/show_bug.cgi?id=695861
2013-03-24 14:31:51 -04:00
Matthias Clasen
38eab78904 broadway: Don't use deprecated gdk_cursor_ref 2013-03-24 14:22:38 -04:00
Matthias Clasen
48d8af85d0 Make gdk_display_open_default_libgtk_only more robust
Make this function return NULL if GDK could not be
initialized. We check this by seeing if there is a
display manager singleton.
2013-03-23 19:40:16 -04:00
Matthias Clasen
c5d7871eda Add gdk_display_manager_peek
Instead of failing with an error if no GDK backend is found like
gdk_display_manager_get(), the new peek function silently returns
NULL.
2013-03-23 19:39:58 -04:00
Matthias Clasen
97ebaee0e2 wayland: Remove a few unused variables 2013-03-23 18:31:20 -04:00
Matthias Clasen
9182eacadf wayland: Don't recreated keymaps on layout change
The GDK model for keymaps expects the keymap object to stay
around and emit a ::keys-changed signal. So, do that. This
should make layout changes work, but it remains untested since
weston does not support layout changes at runtime.

At the same time, plug a memory leak where GdkWaylandKeymap
forgot to free its xkb objects in finalize.
https://bugzilla.gnome.org/show_bug.cgi?id=696339
2013-03-23 18:04:15 -04:00
Matthias Clasen
c6d95a7bdc wayland: remove an unused variable 2013-03-23 17:29:28 -04:00
Matthias Clasen
a70acc03c5 wayland: Respect keymap repeat information
xkb has a function to tell us whether a key should be repeated
or not. Lets use that information.
2013-03-23 17:29:28 -04:00
Colin Walters
d6b4e84957 gdkkeys: Avoid instantiating a display manager if none exists
For introspection scanning which ends up calling class_init() which in
turn calls into the keybindings code, we can just use the fallback
keyval conversion code.

https://bugzilla.gnome.org/show_bug.cgi?id=696457
2013-03-23 17:07:15 -04:00
Marc-André Lureau
564b4e667a win32: do not crash on invalid utf8 conversion
g_utf8_to_utf16() is not guaranteed to succeed. Check the error
and return if it failed.

https://bugzilla.gnome.org/show_bug.cgi?id=696232
2013-03-23 15:50:09 -04:00
Matthias Clasen
d2c8b65fd9 wayland: Pick up more settings
With this commit, we pick up xft settings from GSettings
as well. Among other things, this makes the Large Text
setting work. Still to do: pick up fontconfig changes without
having all clients use up inotify watches for all font
directories.
2013-03-23 13:02:09 -04:00
Matthias Clasen
ce7c6d58c2 Add gdk_set_allowed_backends
This new function allows programmatic control over the
GDK backends that will be used at runtime.
2013-03-23 00:48:26 -04:00
Matthias Clasen
832c698776 Implement GInitable in GdkBroadwayDisplayManager
Add GInitable implementation and fail the initialisation if it is not
possible to set up a broadway server.
2013-03-23 00:48:25 -04:00
Matthias Clasen
bfcf9e471d Implement GInitable in GdkX11DisplayManager
Add GInitable implementation and fail the initialisation if it is not
possible to connect to the display server.
2013-03-23 00:48:25 -04:00
Thomas Wood
09d0d32af0 wayland: implement GInitable and check the connection to the display server
Add GInitable implementation and fail the initialisation if it is not
possible to connect to the display server.

https://bugzilla.gnome.org/show_bug.cgi?id=694465
2013-03-22 22:25:32 -04:00
Thomas Wood
3a9de35a6c gdk: Implement GInitable on GdkDisplayManager
Add GInitable interface with a default implementation that always
succeeds. This allows backends to override the GInitable implementation
and add their own checks to determine if the backend can be loaded.  If
a backend cannot be loaded, GDK can attempt to load the next available
backend.

Since backends may need to read any relevant options (such as the
display flag) to determine if they can be created successfully, this
patch also removes calls that attempt to create the display manager
before the options have been parsed.

https://bugzilla.gnome.org/show_bug.cgi?id=694465
2013-03-22 22:23:39 -04:00
Matthias Clasen
c61956c592 wayland: Implement cursor theme changing
Add gdk_wayland_display_set_cursor_theme and implement it.
2013-03-22 20:30:51 -04:00
Matthias Clasen
8caf1ae7fd wayland: Respect cursor size setting
Respect the cursor size setting when loading the cursor theme.
2013-03-22 19:32:39 -04:00
Matthias Clasen
3278fb9990 wayland: Add cursor-size setting
This will be picked up by cursor themes soon.
2013-03-22 19:27:36 -04:00
Matthias Clasen
37843faea9 wayland: Avoid segfault when cursors are freed
The check for GDK_CURSOR_IS_PIXMAP was ineffective, since _all_
cursors have this type, from the looks of it. Instead, store
buffer ownership information separately.
2013-03-22 19:09:20 -04:00
Matthias Clasen
cc70ac104d wayland: Emit GdkKeymap::state-changed when appropriate
This makes the caps lock warning in password entries work.
2013-03-22 18:34:44 -04:00
Matthias Clasen
1ea760fbc9 wayland: Make key repeat configurable
These might be candidates for a future settings interface; until
then, we use GSettings directly. Note again that we are careful
to avoid a dependency on GNOME schemas.
2013-03-22 18:26:33 -04:00
Matthias Clasen
659ae5172f wayland: Factor out key repeat parameters
This is in preparation for picking these values up from
existing configuration.
2013-03-22 18:09:23 -04:00
Matthias Clasen
9846a37ee3 wayland: Drop an unused variable
The keymap member in GdkWaylandDisplay is not used at all,
so drop it.
2013-03-22 17:53:28 -04:00
Matthias Clasen
6c191b939d wayland: Fix key repeat
Key repeat under X is not affected by modifiers. And on some systems
(e.g my Thinkpad), NumLock is permanently on, rendering key repeat
nonfunctional. This commit changes the Wayland backend to do
key repeat regardless of modifiers.
http://bugzilla.gnome.org/show_bug.cgi?id=695497
2013-03-22 17:43:50 -04:00
Thomas Hindoe Paaboel Andersen
c5145421af wayland: complete cursor_for_pixbuf
Finishes the implementation for loading cursors from pixbufs.

Gnome bug #696223
2013-03-21 18:00:23 -04:00
Kristian Høgsberg
a80998127c wayland: Clear current cusor on leave so we always set it on enter
Commit 0d9d808217 fixed the hotspot issue,
but commit f2cc52fddd then optimized away
cursor changes a little too aggressively.  We always need to set the
cursor on enter.  Make sure we clear the current cursor on leave so we
don't think it's already set on the next enter.

https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-21 08:54:42 -04:00
Matthias Clasen
5f48934943 Wayland: Read settings out of GSettings directly
Until we figure out where we want to go with settings under
Wayland, this makes GTK+ applications a lot easier to deal
with under Wayland.

Note that we are careful to deal with the absence of schemas,
so this does not introduce a dependency on GNOME settings.
2013-03-21 07:15:59 -04:00
Kristian Høgsberg
f2cc52fddd wayland: Only set cursor when it changes 2013-03-20 22:59:06 -04:00
Kristian Høgsberg
62eb5d0358 wayland: Add a cursor cache
We avoid creating a new GdkCursor object every time
_gdk_wayland_display_get_cursor_for_name/type() is called.
2013-03-20 22:56:50 -04:00
Kristian Høgsberg
0d9d808217 wayland: Use the pointer enter serial when setting cursor surface
wl_pointer.set_cursor is rejected if the serial number doesn't match
the enter serial number for the wl_pointer.  We passed the right serial
number when setting the cursor surface in response to the enter event.
Later set_cursor requests fail, but we can still attach new buffers to
our cursor surface, which is why the cursor changed, but the hotspot
didn't update.  Clicking in the decoration results in a leave/enter pair
which triggers wl_pointer.set_cursor with the right serial. That's why
clicking the decoration sets the right cursor.

https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-20 22:56:43 -04:00
Matthias Clasen
26d3fc311b wayland: Keep hotspot when changing cursors
We need to pass the delta between the old and new hotspot
when attaching the new cursor surface, to keep the hotspot
at the same position. We can't deal with this in the compositor,
since the set_cursor call already overwrites the old hotspot,
so the information is lost by the time the attach happens.
Unfortunately, we can't query the initial hotspot from
the compositor, so the first cursor change will make the
hotspot jump.
https://bugzilla.gnome.org/show_bug.cgi?id=695512
2013-03-20 22:21:15 -04:00
Rob Bradford
1b15b9e1bc wayland: Preserve dimensions separately for fullscreen / maximised case
Use separate fields for saving the window dimensions prior to fullscreening
and maximisation. Then use those fields to restore the window dimensions from.
2013-03-19 19:52:49 +00:00
Scott Moreau
1be7f3dee9 wayland: Implement gdk_window_[un]maximize
This allows the buttons in the decorations to maximise the window.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=695945

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 15:51:39 +00:00
Alexander Larsson
8fb60cda19 broadway: Fix assert failure
Requests are not limited in size by BroadwayRequest, as
BroadwayRequestTranslation can be of variable size. No need
to copy the request anymore though, because requests are aligned
now.
2013-03-18 16:41:05 +01:00
Alexander Larsson
99cc5758b1 broadway: Ensure broadway request members are 32bit aligned 2013-03-18 16:41:02 +01:00
Scott Moreau
0d2c461720 wayland: Always attach buffer before committing
With recent changes in attach semantics, we always need to attach before
committing. Without this changes to the window contents to not get reflected
in the content of the surface.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
50cde3658a wayland: Remove unneeded semicolons
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
d8507a3a83 wayland: Remove unused wayland-egl header
This was left over from the work done in commit: d4a9863

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Scott Moreau
89b1947631 wayland: Set title on shell surfaces to window title
We currently use this information to display the title
string in the window list of the desktop shell.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 12:01:55 +00:00
Matthias Clasen
2ca30bf8e8 Define 3.10 version macros 2013-03-17 11:27:53 -04:00
Guido Günther
ece672ab0b gdk_{pointer,keyboard}_grab are deprecated
so mention the non deprecated gdk_device_grab as well
2013-03-17 11:58:21 +01:00
Matthias Clasen
5da58aa71d wayland: Rename GdkDeviceManagerCore to GdkWaylandDeviceManager
The 'core' naming is just an artifact of having several generations
of input extensions in X11, no need to propagate that into other
backends.
2013-03-15 09:19:35 -04:00
Matthias Clasen
469373a1f9 Include config.h in gdkenumtypes.c.template
At the same time, drop the GDK_ENABLE_BROKEN define.
Nothing broken in GDK broken anymore :-)
2013-03-15 09:19:35 -04:00
Chun-wei Fan
b9e189150b gdk/gdkwindow.c, gtk/gtkwidget.c: Include fallback-c89.c
Both of them started to make use of round(), a C99 function.  So, include
fallback-c89.c to provide a fallback implementation for round() for
compilers that don't have round()

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-13 13:22:48 +08:00
Chun-wei Fan
9b7c7ae614 gdk/fallback-c89.c: Add fallback for round()
This is essentially done by simply copying from gtk/fallback-c89.c

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-13 13:22:46 +08:00
Matthias Clasen
0cc688aa92 Drop the Motif DND protocol
The implementation is not working and unused, since XDND is the
de-facto standard under X nowadays.

https://bugzilla.gnome.org/show_bug.cgi?id=695476
2013-03-12 20:03:19 -04:00
Chun-wei Fan
bb4cff8ecf gdk/win32/gdkevents-win32.c: Fix build
The variable "display" is not defined, causing the build to fail.
Judging from the code, it seems that it should be _gdk_display instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-06 22:19:57 +08:00
Alan McGovern
e28b10d56f quartz: Null check title before setting it
This avoids a crash in objective-c.

https://bugzilla.gnome.org/show_bug.cgi?id=695278
2013-03-06 12:37:44 +01:00
Ross Lagerwall
942c63d82b x11: Remove unused macro
https://bugzilla.gnome.org/show_bug.cgi?id=694395
2013-03-04 21:09:06 -05:00
Benjamin Otte
c7cf937789 broadway: pointer targets differ in signedness 2013-03-01 16:25:14 +01:00
Benjamin Otte
9d55b3c6fd broadway: variable 'broadway_display' set but not used 2013-03-01 16:25:14 +01:00
Alexander Larsson
8ee578468d gdkwindow: Update window debug dump code
This makes it build without warning and also dumps alpha
2013-03-01 14:55:54 +01:00
John Ralls
afe8ce2ef7 Fix broken quartz build from df3e19b
It's _gdk_display, not display
2013-02-28 12:34:33 -08:00
Geoff Reedy
c6eddaafed GdkScreen: get a long X property correctly
https://bugzilla.gnome.org/show_bug.cgi?id=691426
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-26 17:58:21 -06:00
Thomas Wood
e97262489c gdk: prevent NULL pointer access when debugging is enabled
If no updates, redraws, or repaints have been scheduled for this frame,
we will skip immediately to RESUME_EVENTS, and no GdkFrameTimings will
be created.

https://bugzilla.gnome.org/show_bug.cgi?id=694732
2013-02-26 15:27:53 +00:00
Aleksander Morgado
399ffbb230 win32: fix possible memleak if GlobalAlloc() fails
Also remove the unused 'buf' variable.

https://bugzilla.gnome.org/show_bug.cgi?id=694742
2013-02-26 15:13:32 +01:00
Matthias Clasen
4fa8029906 Fix a few more doc issues 2013-02-25 10:57:34 +01:00
Matthias Clasen
6fd897bb10 Add available marker to gdk_x11_window_set_utf8_property 2013-02-25 10:54:33 +01:00
Matthias Clasen
82928c2a2a Pedantic fixes
Remove a C99 comment, and line up comment formatting.
2013-02-25 10:54:32 +01:00
Matthias Clasen
67635e9177 Include GdkFrameClock in the docs
Make GdkFrameClock and GdkFrameTimings show up in the docs.
A couple of minor doc fixes are also included.
2013-02-25 10:54:32 +01:00
Matthias Clasen
d7184d6500 Include public headers in gdk.h
gdkframeclock.h and gdkframetimings.h were not directly included
in gdk.h. They should.
2013-02-25 10:54:32 +01:00
Owen W. Taylor
df3e19b449 Broadway/Quartz/Win32: make event source prepare()/check() note paused status
When events are paused, we should not return TRUE from prepare() or check().
GTK+ handles this for events that are already in the GTK+ queue, but
we also need suppress checks for events that are in the system queue - if we
return TRUE indicating that there are events in the system queue, then we'll
call dispatch(), and do nothing. The event source will spin, and will never
run the other phases of the paint clock.

(Broadway doesn't have a window system queue separate from the GDK event queue,
but we write the function the same way for consistency.)

https://bugzilla.gnome.org/show_bug.cgi?id=694274
2013-02-21 09:59:58 -05:00
Thomas Wood
00a107cc4c wayland: don't attempt to unqueue events when events are paused
When events are paused, we should not return TRUE from prepare() or check().
GTK+ handles this for events that are already in the GTK+ queue, but
we also need suppress checks for events that are in the system queue - if we
return TRUE indicating that there are events in the system queue, then we'll
call dispatch(), and do nothing. The event source will spin, and will never
run the other phases of the paint clock.

https://bugzilla.gnome.org/show_bug.cgi?id=694274
2013-02-21 09:59:58 -05:00
Alexander Larsson
3c690c52ba Avoid loop in paint update cycle
Commit 1db87c897f accidentally removed
a check for !in_paint_idle in maybe_start_idle which causes us
to create a paint loop whenever something requests a phase
inside the paint_idle.
2013-02-19 21:12:48 +01:00
Benjamin Otte
de08716526 x11: Handle case where xsettings are NULL 2013-02-19 19:55:02 +01:00
Benjamin Otte
0ed47e1bb7 x11: Fix introspection build
File removal in bb4953f3e8 wasn't checked
in here.
2013-02-19 15:38:08 +01:00
Benjamin Otte
588513fc9a x11: Get rid of XSettingsClient object
Instead, store its variables in the GdkX11Screen.
2013-02-19 14:33:39 +01:00
Benjamin Otte
3eef3290ad x11: Use _gdk_x11_get_xatom_for_display_printf()
instead of keeping the atom around all the time
2013-02-19 14:33:39 +01:00
Benjamin Otte
13eeb6ca33 x11: Introduce _gdk_x11_get_xatom_for_display_printf()
and use it instead of caching the atom in the GdkScreenX11.
2013-02-19 14:33:39 +01:00
Benjamin Otte
b2043511ee x11: Don't keep an "in_init" variable
Instead, track the init state with a boolean argument.
2013-02-19 14:33:39 +01:00
Benjamin Otte
200d6fe664 x11: Clean up xsettings header
- Don't use defines for renames
- Move enum into only source file using it
2013-02-19 14:33:38 +01:00
Benjamin Otte
e1efe3269c x11: Get rid of XSettingsSetting
Use GValue throughout instead.
2013-02-19 14:33:38 +01:00
Benjamin Otte
84679ba78b x11: Remove extra variable
Use a getter instead.
2013-02-19 14:33:38 +01:00
Benjamin Otte
78ce2563be x11: Split xsettings event filter into 2 functions
One for each type of window we watch.
2013-02-19 14:33:38 +01:00
Benjamin Otte
f6d6e932de x11: Make stored xsettings window a GdkWindow 2013-02-19 14:33:38 +01:00
Benjamin Otte
5507954e04 x11: Split function into two
Instead of a boolean is_start, have a start and an end function.
2013-02-19 14:33:38 +01:00
Benjamin Otte
8028a5b24a x11: Use gdk_display_flush() 2013-02-19 14:33:38 +01:00
Benjamin Otte
c91843edea x11: Get selection atom useing GDK functions
Don't call XInternAtoms ourselves.
2013-02-19 14:33:38 +01:00
Benjamin Otte
8596142336 x11: Warning improvements to xsettings code
... and using g_warning() instead of fprintf()
2013-02-19 14:33:37 +01:00
Benjamin Otte
01be4ce166 x11: Use usual Atom handling in xsettings code 2013-02-19 14:33:37 +01:00
Benjamin Otte
ed38dbe28f x11: Consolidate root window event setting in one place
No need to duplicate things in xsettings code.
2013-02-19 14:33:37 +01:00
Benjamin Otte
9ed7e883f2 x11: Remove unused argument 2013-02-19 14:33:37 +01:00
Benjamin Otte
edf19ab7b4 x11: Store GDK name in xsettings hash table
The X name is only used while reading the property, so no need to keep
it.
2013-02-19 14:33:37 +01:00
Benjamin Otte
afa3d611d6 x11: Remove XSettingsAction type
Use GdkSettingAction instead.
2013-02-19 14:33:37 +01:00
Benjamin Otte
a4f11fa4f5 x11: Make xsettings callbacks code go away
It's the same callbacks every time, so just move them into the source
file.
2013-02-19 14:33:37 +01:00
Benjamin Otte
c3607fd551 x11: Don't store name in XSettingsSetting anymore
This is in preparation to switching XSettingsSetting to GValue
2013-02-19 14:33:36 +01:00
Benjamin Otte
30a4150c8e x11: Use boolean instead of enum for errors in xsettings code 2013-02-19 14:33:36 +01:00
Benjamin Otte
23b039c8cd x11: Move error reporting to where the error happens
Also, use g_warning() instead of fprintf().
2013-02-19 14:33:36 +01:00
Benjamin Otte
b36b89151e x11: Move length checking into return_if_fail() macro 2013-02-19 14:33:36 +01:00
Benjamin Otte
e3206b9de4 x11: Use GDK error trapping code 2013-02-19 14:33:36 +01:00
Benjamin Otte
c84e303fb5 x11: Split out xsettings string reading code 2013-02-19 14:33:36 +01:00
Benjamin Otte
2b83062fc6 x11: Clean up xsettings header
Move private struct definitions into source file, remove unneeded C++
guards.
2013-02-19 14:33:36 +01:00