Commit Graph

5534 Commits

Author SHA1 Message Date
Benjamin Otte
1d2a070254 x11: Don't crash if a window is on an unmanaged screen
_gdk_x11_display_screen_for_xrootwin() can return NULL. If so, return
NULL from gdk_x11_window_foreign_new_for_display().

https://bugzilla.gnome.org/show_bug.cgi?id=709716
2013-11-25 21:14:34 +01:00
Carlos Garnacho
d1414211bf x11: keep track of the screen pixel size by calculating the bounding box of monitors
This is so we always have the latest information given by XRandR (or other), and not
rely on Core protocol information that might not have been updated yet.

This is specially visible when a monitor is connected (less frequent) or disconnected
(much more frequent), callbacks on GdkScreen::monitors-changed that call
gdk_screen_get_width/height() could get the screen size previous to the monitor
rearrangement.

So in order to fix this, keep track of the latest monitors information, and calculate
the bounding box in order to know the screen size.

https://bugzilla.gnome.org/show_bug.cgi?id=715029
2013-11-25 17:19:46 +01:00
Philip Withnall
86b6170940 gdkwindow: Fix potential uses of uninitialised variables
Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-11-24 21:20:44 +00:00
Carlos Garnacho
a53a931755 x11: Unset GdkX11DeviceXI2 scroll valuators on device change
Scroll valuators were being just appended again and again, leading
to 1) a growing memory issue anytime a device changed 2) the first
scroll valuators to stay permanent on the application lifetime, as
the first stored valuators would always match.

https://bugzilla.gnome.org/show_bug.cgi?id=705203
2013-11-22 12:49:32 +01:00
Jasper St. Pierre
aa02b5b909 wayland: Sync transient-for on xdg-surface show as well... 2013-11-21 13:04:00 -05:00
Jasper St. Pierre
9232089b35 wayland: Allow set_title after initial showing
and fix the ordering of title / app_id
2013-11-21 13:04:00 -05:00
Jasper St. Pierre
750419e8d9 Update xdg-shell.xml 2013-11-21 13:03:59 -05:00
Jasper St. Pierre
03ad459c5b Update xdg-shell.xml 2013-11-19 18:59:50 -05:00
Jasper St. Pierre
937dd010d0 wayland: Don't assert fail in DND
This needs completion, sure thing, but let's try to just not fall
flat on our face first.
2013-11-19 18:55:26 -05:00
Jasper St. Pierre
96ca7fe6e6 wayland: Don't recreate the gtk_surface on every show
It's illegal.
2013-11-19 18:40:58 -05:00
Jasper St. Pierre
6f9b2ac805 wayland: Set DBus properties after we've constructed the xdg_surface 2013-11-19 16:37:25 -05:00
Jasper St. Pierre
7e3e50729f wayland: Fix invalid cast in transient_for 2013-11-19 12:36:27 -05:00
Carlos Garnacho
fee754e0d2 gdk: Ignore crossings generated by passive grabs when resetting scroll axes
Passive grabs may take pointer focus out of the application, even though
the pointer didn't leave the window, but those events still trigger resetting
of the scroll axes. This is most visible with compiz, and possibly other
reparenting WMs, where passive grabs happen on the WM-managed window that
is a parent of the application toplevel.

As it is not possible to have scrolling happening on the timespan a passive
grab takes action, it is entirely safe for GTK+ to assume none happened if
it gets a crossing event of that nature.

https://bugzilla.gnome.org/show_bug.cgi?id=699574#c33
2013-11-18 22:12:18 +01:00
Jasper St. Pierre
9127087e1c wayland: Replace wl_shell_surface with xdg_shell 2013-11-18 13:44:20 -05:00
William Hua
a41305135c Fix missing return and closing brace.
https://bugzilla.gnome.org/show_bug.cgi?id=712514
2013-11-18 06:01:51 -05:00
Carlos Garnacho
962415aeb7 x11: Add extra debug spew on XI2 crossing and button events
This information will be useful in case someone stumbles on a situation
similar to https://bugzilla.gnome.org/show_bug.cgi?id=699574, so we can
figure out where do the crossing events come from or go to easily.
2013-11-17 00:42:18 +01:00
Carlos Garnacho
4168c3cab9 gdk: be more selective resetting scroll events
It's been reported in several applications that scrolling feels jerky
since commit cc7b3985b3.

Investigation reported that the combination of passive 4-7 button grabs
on the toplevel and the presence of native subwindows might trigger
too often crossing events from the child window to the toplevel and
back as scroll "buttons" trigger the passive grab. Those crossing events
would reset the scroll valuators rendering scrolling from jerky on
touchpads (where there's intermediate smooth events between the emulated
button ones) to ineffective on regular mouse wheels (where the crossing
event would reset the valuators right before the single smooth scroll
event we get is delivered)

So, only reset scroll valuators when the pointer enters the toplevel
(we only care about this when the pointer is on the window after it's
been possibly scrolling somewhere else), and it doesn't come from an
inferior.

The situations where this happened varied though, the native subwindow
could be one created explicitly by the application, or created indirectly
through gdk_window_ensure_native(). The latter was mainly the case for
evolution (through gtk_selection_set_owner()) and any GtkScrolledWindow
under the oxygen-gtk3 theme (through gdk_window_set_composited())

https://bugzilla.gnome.org/show_bug.cgi?id=699574
2013-11-17 00:42:18 +01:00
Martin Renold
701daf2b05 gdk: Document event compression better
Advise against using GDK_POINTER_MOTION_HINT_MASK.
Add pointers to gdk_window_set_event_compression() to the documentation.
2013-11-16 01:50:53 +01:00
Matthias Clasen
2fb64cf0e7 Win32: Set the shows-desktop platform setting
Win32 shows icons on the desktop, so set shows-desktop
to TRUE here.
2013-11-15 07:51:22 -05:00
Matthias Clasen
b3f17ea915 Quartz: Set the shows-desktop platform setting
OS X shows icons on the desktop, so set this setting
to TRUE here.
2013-11-15 07:50:37 -05:00
Ryan Lortie
a90bb7de0e Add a GtkSetting for 'shell-shows-desktop'
Add a GtkSetting for whether the desktop shell is showing the desktop
folder icons.

This is on by default because most desktop shells do show the icons on
the desktop.  We already have a patch in gnome-settings-daemon to bind
this to the org.gnome.desktop.background show-desktop-icons GSettings
key which is off by default on GNOME.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-14 15:03:04 -05:00
Alexander Larsson
67bcc6f04f broadway: Improve touch events
We now respect core pointer grabs, and we do the pointer emulation
detection on the browser side.
2013-11-14 11:05:16 +01:00
Alexander Larsson
4226f97d54 broadway: Support ipad on-screen keyboard
We add a custom im module for broadway that calls some broadway
specific APIs to show/hide the keyboard on focus in/out. We then forward this
to the browser, and on the ipad we focus an input field to activate
the keyboard.
2013-11-13 12:23:06 +01:00
Alexander Larsson
ca89f5ab93 broadway: Send focus out events 2013-11-13 12:23:06 +01:00
Alexander Larsson
6917746c8e broadway: Fix focus handling with touch events 2013-11-13 12:23:06 +01:00
Chun-wei Fan
42bdbd8c30 gdk/win32/gdkevents-win32.c: Fix typo
...to fix the build on Windows.
2013-11-13 16:18:12 +08:00
Alexander Larsson
4e8fa55827 broadway: Support window resize/drag via touch 2013-11-12 16:45:14 +01:00
Alexander Larsson
82acc05cba broadway: Add initial touch event support
This seems to get something going on an ipad, but some events seem
to get swallowed. For instance, window dragging doesn't work.
2013-11-12 16:11:15 +01:00
Alexander Larsson
d21ac217d3 broadway: Disable all kinds of viewport scrolling and zooming 2013-11-12 13:44:56 +01:00
Alexander Larsson
e331d17626 broadway: Raise window on first click. 2013-11-12 12:36:05 +01:00
Alexander Larsson
d8c17d0739 broadway: Add raise/lower ops 2013-11-12 12:23:58 +01:00
Alexander Larsson
ddade66496 broadway: use 'click-to-focus' approach instead of 'focus-follows-mouse'
The broadway backend would move the focus from one window to another based on
where the mouse was (i.e. 'focus-follows-mouse' approach). Handling the focus
this wait didn't play well with widgets which rely on focus-in-event and
focus-out-event, like the GtkEntry when using a completion popup window, see
e.g:
  https://bugzilla.gnome.org/show_bug.cgi?id=708984

So instead, setup broadway to require a click in a window to move the focus
(i.e. 'click-to-focus' approach):

 * The implicit GDK_FOCUS_CHANGE events that were generated upon reception of
   BROADWAY_EVENT_ENTER or BROADWAY_EVENT_LEAVE are removed.

 * The broadway daemon will now keep track of which is the focused window

 * Whenever the daemon detects an incoming BROADWAY_EVENT_BUTTON_PRESS, it will
   trigger the focused window switch, which sends a new BROADWAY_EVENT_FOCUS to
   the client, specifying which windows holds the focus.

 * Upon reception of a BROADWAY_EVENT_FOCUS, the client will generate a new
   GDK_FOCUS_CHANGE.

 * gdk_broadway_window_focus() was also implemented, which now requests the
   focus to the broadway server using a new BROADWAY_REQUEST_FOCUS_WINDOW.

This is based on an initial patch from Aleksander Morgado <aleksander@lanedo.com>.
2013-11-12 12:03:50 +01:00
Owen W. Taylor
f50a3af1b7 Handle recursion from motion event handlers
If a motion event handler (or other handler running from the flush-events
phase of the frame clock) recursed the main loop then flushing wouldn't
complete until after the recursed main loop returned, and various aspects
of the state would get out of sync.

To fix this, change flushing of the event queue to simply mark events as
ready to flush, and let normal event delivery handle the rest.

https://bugzilla.gnome.org/show_bug.cgi?id=705176
2013-11-11 23:17:14 -05:00
Owen W. Taylor
fbfeb00545 Fix warning with event compression on a destroyed window
Fix a critical message when we try to compress events for a window
that was already destroyed.
2013-11-11 18:20:09 -05:00
Marc-André Lureau
c486c0983f gdk/win32: remove extra allocation for \r removal
Although I can't find explicit documentation for clipboard pointer, it
seems to be possible to modify clibpoard memory without side-effects.

According to MSDN,
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366596%28v=vs.85%29.aspx

"The global and local functions are supported for porting from 16-bit
code, or for maintaining source code compatibility with 16-bit
Windows. Starting with 32-bit Windows, the global and local functions
are implemented as wrapper functions that call the corresponding heap
functions using a handle to the process's default heap."

"Memory objects allocated by GlobalAlloc and LocalAlloc are in private,
committed pages with read/write access that cannot be accessed by other
processes. Memory allocated by using GlobalAlloc with GMEM_DDESHARE is
not actually shared globally as it is in 16-bit Windows. This value has
no effect and is available only for compatibility. "

https://bugzilla.gnome.org/show_bug.cgi?id=711553
2013-11-09 11:58:03 -05:00
Daniel Sabo
80dd1a851a Add an event_compression setting to GdkWindow
Setting event compression to false will allow inter-frame
mouse motion events to be delivered, which are necessary
for painting applications to produce smooth strokes.

https://bugzilla.gnome.org/show_bug.cgi?id=702392
2013-11-09 00:01:05 -05:00
Alexander Larsson
180517f5e8 broadway: Add buffer decoding colorizing
If you add ?debug=decoding to the url you will get colorized debug
info for the buffer decoder.
2013-11-08 13:44:00 +01:00
Alexander Larsson
688b6e63b5 broadway: Extract buffer decoding to separate helper 2013-11-08 13:44:00 +01:00
Rico Tzschichholz
b851db113e broadway: Add rawinflate.min.js to EXTRA_DIST
In addition to 149b3af105
2013-11-07 17:44:08 +01:00
Alexander Larsson
149b3af105 broadway: Use zlib compression for broadway buffers
This imports the MIT licensed js unzip from:
https://github.com/imaya/zlib.js

and uses it to decompress in js on the client side.
2013-11-07 14:09:53 +01:00
Alexander Larsson
5ef114ba42 Switch from sending png frames to our own encoding
This is based on the rolling hashes code from
http://cgit.freedesktop.org/~krh/weston/log/?h=remote

It works by incrementally calculating hashes for every 32x32 block
in each frame sent, and then refering back to such blocks when
encoding the next frame. This means we detect when a block matches
an existing block in the previous frame in a different position.
This is great for detecting scrolling, which we need now that
the gdk level scrolling is neutered.
2013-11-07 14:09:53 +01:00
Alexander Larsson
bbfe7e0e69 broadway: Always use client side decorations 2013-11-07 14:09:53 +01:00
Alexander Larsson
c6a3c0e4eb broadway: Implement gdk_window_begin_move_drag() 2013-11-07 14:09:53 +01:00
Alexander Larsson
3be4038d02 broadway: Add gdkbroadwaydisplay.h include 2013-11-07 14:09:53 +01:00
Alexander Larsson
6e308dc7c7 broadway: Simplify frame handling and make it ARGB32
This completely removes the delta compression and makes all buffers ARGB.
This is obviously slower, but this will be re-integrated later.
2013-11-07 14:09:53 +01:00
Alexander Larsson
b436f06a94 broadway: Remove window translation code
This is no longer used as we neutered gdk_window_scroll & co.
2013-11-07 14:09:53 +01:00
Jasper St. Pierre
0a40951f40 Revert "broadway: Fix gcc warning"
This reverts commit f0d3d72574.
2013-11-05 11:14:01 -05:00
Benjamin Otte
f0d3d72574 broadway: Fix gcc warning 2013-11-04 16:36:11 +01:00
Manuel Bachmann
55dba74a24 Win32 : fixes Bug 679019 (Popup menu misplaced in dual monitor) 2013-11-01 17:59:05 +01:00
Cody Russell
46fbefe795 Win32: Honor the geometry when GDK_HINT_MAX_SIZE is set.
The MINMAXINFO struct was being populated based upon geometry hints when
GDK_HINT_MAX_SIZE flag was enabled, then promptly having its values blown
away with default values.

https://bugzilla.gnome.org/show_bug.cgi?id=711110
2013-10-31 15:54:28 -05:00