Commit Graph

603 Commits

Author SHA1 Message Date
Alexander Larsson
aa8693f2cb Track viewable for GdkWindow 2009-07-18 23:11:54 +02:00
Alexander Larsson
db4dabf5e7 GDK_WINDOW_TYPE does a runtime typecheck, don't call it unnecessary
Looking at a profile the typecheck from GDK_WINDOW_TYPE stood out quite
a bit, which is fixed by not using it unnecessarily.
2009-07-18 15:06:27 +02:00
Alexander Larsson
d0366e5160 Don't draw to unviewable windows
The scrolling and region moving code needs to avoid drawing when the
window is mapped, which it did. However, it also needs to avoid
drawing when any of its parents are not mapped, which it didn't so
switch to using gdk_window_is_viewable().

This fixes the index rendering in evolution (#588169)
2009-07-11 00:33:52 +02:00
Alexander Larsson
9044ec9bb9 Correctly set enter/leave events as detail=nonlinear
If we get a nonlinear enter/leave notify on the toplevel we need
to set nonlinear in all the events we send, even if the in-toplevel
tree is linear.

This fixes combobox menus popping down immediately when you click
(not hold). (bug #587559)
2009-07-09 17:06:46 +02:00
Alexander Larsson
a90d43bed6 Don't emulate map/unmap events for native windows
We really need to wait for the MapNotify from the xserver to ensure
that the window has been mapped, as it may be delayed by the WM, network
or similar things.

This fixes a problem in the /ui-tests/keys-events gtk test
2009-07-08 18:47:43 +02:00
Alexander Larsson
62db28607b The shape is in window coordinate, so properly offset it when using it 2009-07-07 17:10:49 +02:00
Matthias Clasen
b3969a3d75 2.17.3 2009-07-07 01:05:29 -04:00
Matthias Clasen
93556ea899 Make distcheck pass 2009-07-06 23:06:46 -04:00
Matthias Clasen
a213b00d8b More documentation fixes 2009-07-05 20:56:45 -04:00
Matthias Clasen
8031910e21 Add doc stubs 2009-07-03 15:22:02 -04:00
Alexander Larsson
2e3866b5b2 Make GdkDrawable draw_drawable backwards compat
Turns out pygtk build broke due to the argument addition to draw_drawable.
So, we now add a new vfunc for the new draw_drawable and are thus
backwards compat.
2009-07-01 19:50:49 +02:00
Alexander Larsson
038398d493 Move new draw_drawable argument to end to make it more backwards compat 2009-07-01 16:13:31 +02:00
Alexander Larsson
10bf7ca744 Clean up embedding api
we now use gdk_offscreen_window_set_embedder() instead of a signal
to get the parent. This also replaces set_has_offscreen_changes.

Rename "parent" in all embedding related names to "embedder" to make it
more obviously different than the normal parent.

Rename gdk_window_get_offscreen_pixmap to gdk_offscreen_window_get_pixmap
to match the other offscreen calls.

Rename gdk_window_offscreen_children_changed to gdk_window_geometry_changed
as this is more descriptive.
2009-07-01 14:36:36 +02:00
Alexander Larsson
11a96ce2f6 Don't use GDK_WINDOW_SCREEN, as its an X11 specific macro 2009-07-01 10:28:05 +02:00
Alexander Larsson
0c6f64a76c Don't return value from void function
This fixes the previous commit where the return value was removed.
2009-07-01 10:27:54 +02:00
Alexander Larsson
3b6cf72f39 Move destroyed check to common code for get_origin & get_root_coords
Also remove weird return value from get_root_coords
2009-06-30 09:30:53 +02:00
Alexander Larsson
64e7c7828d Don't hide foreign children when emulating visibility
We emulate visibility by unmapping (in X) all mapped (according to
gdk) windows that are not visible (all parents mapped). This is because
there may be client side windows inbetween the native windows in the
hierarchy, so you can't know a native window is visible just because
all the parent native windows are mapped.

However, we don't want to unmap foreign windows, as that may cause all
sort of unexpected issues. This should be safe, because generally the
parent of a foreign window is a native window (e.g. a socket), so its
gdk visibility state is the same as the Xserver one.

This fixes an issue with the GDM notification area where the unmap of
the plug caused spurious UnmapNotify events that confused GtkSocket and
caused icons to become one pixel wide.
2009-06-26 20:11:57 +02:00
Alexander Larsson
c84c0e92f8 Better implementation of native clear_area
Last commit was bad, as it didn't clip against client side
children. This implements such clipping first and then
only clears the rectangles that need to be cleared.
2009-06-26 17:07:24 +02:00
Alexander Larsson
0e548579de Implement gdk_window_clear_area natively for foreign windows
This fixes a redraw issue with the notification area in xfce4.
2009-06-26 15:45:53 +02:00
Alexander Larsson
4e902cd223 Clip cairo drawing against client-side child windows
This is how cairo works with native children.
This fixes an issue where the drag target outline is visible on the
evolution folder treeview when it isn't with native windows.
2009-06-26 14:20:05 +02:00
Alexander Larsson
43bc999e6d Ensure that we always calculate clip regions for root windows
Without this we can't draw to them, which caused problems for e.g.
gnome-settings-daemon clearing the background when the desktop
background changed.

Note: We don't actually clip away child windows from the root window,
the clip is just based on the size of the root window.
2009-06-25 17:05:21 +02:00
Alexander Larsson
794f2815de Fix g_signal_emit calls
The switch to g_signal_emit was all messed up, I forgot to add signals[]
around the signal enum and did not pass in the detail quark.
2009-06-25 17:04:18 +02:00
Alexander Larsson
cf1c6bc2ed Fix typos 2009-06-24 20:59:29 +02:00
Alexander Larsson
955da9fc76 Factor out common code to sync_native_window_stack_position 2009-06-24 20:56:05 +02:00
Alexander Larsson
b093db8da9 Use g_signal_emit instead of g_signal_emit_by_name when possible 2009-06-24 20:33:13 +02:00
Alexander Larsson
8518aa2bf3 Rename accumulate_get_parent to accumulate_get_window
This function is used in several places, not just get_parent
2009-06-24 20:25:40 +02:00
Alexander Larsson
0c7a26690d Fix spelling of synthesize 2009-06-18 20:58:13 +02:00
Alexander Larsson
c08bf93fe5 Don't reset window hints when showing multiple times
gdk_window_show() should only set the initial hints on the first
run, not if the window is already mapped when gdk_window_show is
called.
2009-06-16 21:34:37 +02:00
Alexander Larsson
d44d5301a6 Remove ununsed variables 2009-06-12 12:47:20 +02:00
Alexander Larsson
bd0e95081f Always return FALSE from idle callback to avoid loop
In the destroyed window case in do_synthesize_crossing_event we didn't
return a value which can cause infinite "loops". Always return FALSE
to make sure the idle doesn't run again.
2009-06-12 12:45:31 +02:00
Alexander Larsson
56dfbd997e Handle gdk_window_beep on offscreen windows 2009-06-11 22:11:48 +02:00
Alexander Larsson
5dc6709ea0 Handle the window being destroyed in do_synthesize_crossing_event
This can happen since we ref the window and do the function in an idle.
2009-06-11 21:56:02 +02:00
Alexander Larsson
278e5bd170 Send crossing event due to geometry change in idle
Doing this directly had some issues with picking going recursive in
clutter-gtk. Furthermore, doing it in an idle means we can coalesce
multiple calls (which is common due to widget changes) in the same
toplevel to just one call.
2009-06-11 21:49:17 +02:00
Alexander Larsson
4987ca9235 Add gdk_window_offscreen_children_changed call
You can call this if you have offscreen children and the geometry of
them changed. This will cause re-picking of the active window sending
enter and leave events as needed.
2009-06-11 12:06:01 +02:00
Alexander Larsson
4d54de336b Add gdk_window_get_root_coords
We want to be able to map any window coordinate to a root coordinate, not
just the origin, because you can't rely anymore on a simple translation
from window coordinates to parent with offscreen windows. This lets
us e.g. pop up menus in the right place even if they are popped up from
a no-window widget.
2009-06-08 20:01:05 +02:00
Alexander Larsson
a8549898ab Update event emulation to handle offscreen children
We use the offscreen signals for getting parent, picking
children at a point and mapping coordinates between windows
embedding offscreens and offscreens.

This means we have two hierarchies more or less, one visible to apps via
the standard APIs and for drawing where the offscreens are their own
separate toplevels, and another one for event handling where embedded
offscreens appear as if they were children of the embedding window.
2009-06-08 19:42:34 +02:00
Alexander Larsson
904f0ccb7c Base pointer grab on get-offscreen-parent 2009-06-08 19:39:14 +02:00
Alexander Larsson
e1b52da0ab Add signals for offscreen window embedding
3 signals are for offscreen windows
get-offscreen-parent: Get the parent window an offscreen is embedded in
to-parent: Convert coordinates from offscreen to parent
from-parent: Convert coordinates from parent to offscreen

1 signal is for the window embedding offscreens:
pick-offscreen-child: This picks what (if any) offscreen is at a specific position

The last signal is only used if you call gdk_window_set_has_offscreen_children
to tell gdk that the window has embedded offscreen children.
Add get-pointer signal for offscreen window pointer getting

Apps using offscreen windows can connect to get-pointer on offscreen
windows in order to make gdk_window_get_pointer() return correct
values.

Add get-offscreen-parent signal

Add signals for from-parent and to-parent coordinate mapping

Add pick-offscreen-child signal
2009-06-08 19:39:06 +02:00
Alexander Larsson
247e1945a0 window_get_pointer should return the direct child
We returned the innermost child that has the pointer, which is not right.
Only the direct child that has the pointer in it should be reported (if any).
2009-06-05 15:18:36 +02:00
Alexander Larsson
9437138db2 Fix some warnings added by the input handling
Add casting and actually fix parenthisation of boolean expression
2009-06-03 11:24:27 +02:00
Alexander Larsson
609b03c517 Further clean up window drawing redirection/clipping
This combines the OFFSET_GC and various SETUP/RESTORE gc macros
to a single BEGIN/END_DRAW macro pair.
2009-06-01 14:48:11 +02:00
Alexander Larsson
1d739c2ff6 Fix up gdk_window_set_has_native rename issues
Seems like i forgot a bunch of things.
2009-06-01 14:47:38 +02:00
Alexander Larsson
e123931a65 Add more GdkWindow implementation docs 2009-06-01 13:38:04 +02:00
Alexander Larsson
a84cc4e9f3 Whitespace cleanup gdkwindow.c
Almost everything here changed anyway, so might as well clean it up.
2009-06-01 12:04:36 +02:00
Alexander Larsson
287b821705 Rename gdk_window_set_has_native to gdk_window_ensure_native
This also removes the (unimplemented) possibility to change a window to
non-native. This seems generally not very useful, and there are some problems
with it, for instance if two "users" need a window to be native and then
one of the "users" doesn't need it anymore it can't change it back, because
it is unaware of the other reason the window is native.
2009-06-01 11:57:59 +02:00
Alexander Larsson
7372379c24 Initial version of input support 2009-05-29 16:39:12 +02:00
Alexander Larsson
0b586a5ad7 Add support for client side graphics exposures in gdk_draw_drawable 2009-05-27 17:10:32 +02:00
Alexander Larsson
8cb385cd31 Add support for visibility notification 2009-05-26 20:53:48 +02:00
Alexander Larsson
8a689f2e15 Handle flushing implicit paint while there is a paint outstanding
If a native window or a window with a native subwindow is moved or resized
then the client window moves and implicit paints need to be flushed since
the native window move will copy/overwrite data. This may happen while there
is an outstanding paint if the move is inside an expose event (weird, but
flash embedded in webkit hit this).

Right now we're asserting here, but the right fix is to allow this but
to not flush the parts that are currently in a (non-implicit) paint. This
means we flush all results from previous not-yet-flushed exposes, but not
the ones being drawn.
2009-05-26 11:30:46 +02:00
Alexander Larsson
d64b51de4d Fix coordinates for background clearing when redirecting
Backport from svn of this fix
2009-04-02 10:16:30 +02:00
Alexander Larsson
255ec543b1 Ensure offscreen windows are not used as non-toplevels 2009-04-02 10:16:30 +02:00
Alexander Larsson
2c877d4c2d Remove offscreen hooks support
In the new world offscreen windows are not put in the hierarchy, but are
rather toplevels for themselves. Offscreen hooks don't make any sense
in this model.
2009-04-02 10:16:30 +02:00
Alexander Larsson
1208c2fa11 Fix x vs y typo 2009-04-02 10:16:29 +02:00
Cody Russell
3fdd1333b2 Misc stuff 2009-04-02 10:16:29 +02:00
Cody Russell
a93c6cd6e1 CSW Win32 work in progress - builds but does not work yet. 2009-04-02 10:16:29 +02:00
Alexander Larsson
05d3fc6bbd Try to combine consecutive window moves into one
It often happens that we move region A to B and then we move a subset
of B to C. When possible we'd like to replace this with a move from
A directly to C, and a suplimentary move from A to the areas of B not
overwritten by C.

Getting an optimal move combiner seems quite complicated, but this
simple approach gets most of the interesting cases right and isn't
all to complicated.
2009-04-02 10:16:29 +02:00
Alexander Larsson
f0fb3f450f Free region also if its empty (we're taking ownership now) 2009-04-02 10:16:29 +02:00
Alexander Larsson
c35e0e11da Move unnecessary window copies to the right place
This code got placed wrong, it should happen when processing updates
on the impl window so it affects the whole expose, not in begin_updates.
2009-04-02 10:16:28 +02:00
Alexander Larsson
51010ca066 Remove invalid source area from copy in move_region_on_impl
There is no need to copy something that is already invalid and will
be marked as invalid in the destination anyway, so we remove this
area from the region to copy.
2009-04-02 10:16:28 +02:00
Alexander Larsson
e4b26d3231 Move GdkWindowRegionMove construction/destruction to separate functions 2009-04-02 10:16:28 +02:00
Alexander Larsson
3866ea0539 Use clearer names for GdkWindowRegionMove members 2009-04-02 10:16:28 +02:00
Alexander Larsson
184dbd5782 queue expose translations after the actual pixel copy
The expose translation is useful for tracking how outstanding
invalid (exposed on server) areas are copied, and how we need to
compensate for that on the client side to redraw the right area.

So, we should queue the translation at the time we actually move
the bits on the server side, not when moving the window on the
client side.

Also, clean up some naming of parameters.
2009-04-02 10:16:28 +02:00
Alexander Larsson
fb3032af04 Fix order of outstanding moves in queue
The last added move should be done last, so we need to append moves
not prepend
2009-04-02 10:16:28 +02:00
Alexander Larsson
5742005aa1 Make outstanding window moves work with the new model
We now copy outstanding window moves directly on the window and
not to an intermediary pixmap, this means our previous code to
combine window copies was wrong (it relied on each copy not
destroying the source date).

Furthermore, we can't just remove all the update area from the
destination of the outstanding moves, as sometimes things get
copied into that area and then used as the source of another
copy.

We replace the previous window copy combining with a naive
version that just queues each move, just to get things right.
Further work to optimize copies is possible.

Also, we don't remove copy destinations that are used as source
for later copies.

We also clean up the memory management by not having
move_region_on_impl taking ownership of the passed in region.
2009-04-02 10:16:28 +02:00
Alexander Larsson
5ccc8b2ff1 Don't clear background on no exposure mask if NULL background pixmap set
This is the same as background None in X, i.e. never draw the background.
2009-04-02 10:16:28 +02:00
Alexander Larsson
96bc993786 Don't event process updates for foreign windows 2009-04-02 10:16:28 +02:00
Alexander Larsson
8690d19f03 Don't touch private->parent after its been change
The backend reparent may change private->parent, so we must use
the old saved value.
2009-04-02 10:16:27 +02:00
Alexander Larsson
7d51b4179d Clear background on expose with no EXPOSURE_MASK
Apps that set no exposure mask rely on the system clearing things
to the window background, so we need to do this ourselves.

Also, don't do this on foreign windows, as they are not controlled
by us. In fact don't do exposes on foreign windows either.
2009-04-02 10:16:27 +02:00
Alexander Larsson
16b4c3ade8 Call backend show() in gdk_window_show even if window is mapped
This is required for the GtkSocket code, as it shows the plug child
even though the current cached state is (wrongly) that its already
mapped.

This makes blink work for non-local case in testsocket.
2009-04-02 10:16:27 +02:00
Alexander Larsson
aa20a6b0b5 Refactor background clearing code so we can clear a general region 2009-04-02 10:16:25 +02:00
Alexander Larsson
490cbf84cd Be more explicit about when to flush moves
Also makes the non-doublebuffered case work better by flushing before we
call _gdk_windowing_window_process_updates_recurse.
2009-04-02 10:15:33 +02:00
Alexander Larsson
22da9d08da Destroy native children when recursing from a destroy on a virtual window
Native descendants of a virtual children are not automatically destroyed
with the parent as if it was a native window, so we need to handle
the native recursion tracking manually in _gdk_window_destroy_hierarchy()
2009-04-02 10:15:33 +02:00
Alexander Larsson
d35b723261 Only translate native motion events to motion events
Crossing events don't have the device field, which we would like to
pass on, so only do motion events from motion events.
2009-04-02 10:15:33 +02:00
Alexander Larsson
50a5f6046d Don't set the background for input only window
This is not allowed and will cause X errors.
2009-04-02 10:15:33 +02:00
Alexander Larsson
a7b6139029 Fix assert, it was checking the wrong window
We keep the update freeze count in the impl_window, not in
child windows.
2009-04-02 10:15:33 +02:00
Alexander Larsson
53511cb653 Enable custom event masks for native windows
Some apps really need to set custom event masks on native child windows,
for example emacs sets the event masks with gdk, but then reads out
the raw X events via a filter, so gdk event emulation doesn't work for that.

When we get motion or button events we map back from the event position and
window to the toplevel before doing anything, because a toplevel native window
could e.g. overlap a child window or whatever.
2009-04-02 10:15:32 +02:00
Alexander Larsson
fe3c410048 Filter out all native grab/ungrab events with detail INFERIOR
These are generated when we get an implicit grab on a native
child window, and we can't filter them with _has_grab() because
they are sent before the button press event where we detect
the implicit grab.

This makes clicks work in the flash plugin again
2009-04-02 10:15:32 +02:00
Alexander Larsson
20c81eca6a Return ignoring of native grab/ungrab events when we don't have a grab
It turns out we really have to ignore grab/ungrab events or we'll
report double crossing events when we grab or ungrab.

However, we also can't ignore crossing events from grabs from other clients
as that leads to missed enter/leave events on e.g. alt-tab in metacity.

Fortunately we now track grabs very precisely, so we know with certainty
whether we have a grab at the time (serial) of the native crossing events,
and only if we do we ignore them.
2009-04-02 10:15:30 +02:00
Alexander Larsson
53269a5042 Handle crossing events with subwindows unknown to gdk
If we get crossing events with subwindow unexpectedly being NULL
that means there is a native subwindow that gdk doesn't know about.
We track these and forward them, with the correct virtual window
events inbetween.

This is important to get right, as metacity uses gdk for the frame
windows, but gdk doesn't know about the client windows reparented
into the frame.
2009-04-02 10:15:30 +02:00
Alexander Larsson
5be3f38535 Move implicit grab tracking totally to common code 2009-04-02 10:15:30 +02:00
Alexander Larsson
26cbf87d7d New approach for grab tracking code
We try to track the exact grab state, i.e. whats valid on the client
now and whats comming soon via the xserver roundtrip (and when).
2009-04-02 10:15:30 +02:00
Alexander Larsson
a6e647863d Only sync the display if creating a native window implicitly 2009-04-02 10:15:29 +02:00
Alexander Larsson
e631d2d2d4 Sync the display when creating a native window.
This is needed because we want to be able to use the xid immediately
even from another process or another connection to the display.
2009-04-02 10:15:29 +02:00
Alexander Larsson
089c9ca2f1 Don't warn about unexpected events on foreign windows
We don't really control these events so its not wrong per se
to have them generate stuff we don't expect.
2009-04-02 10:15:29 +02:00
Alexander Larsson
177b53a079 Fix typo in gdk_window_input_shape_combine_region 2009-04-02 10:15:29 +02:00
Alexander Larsson
8b7d8431aa Make gdk_window_get_toplevel() for CHILD window with root as parent
Having GDK_WINDOW_CHILD windows with root as the parent apparently works,
and metacity uses it. The current gdk_window_get_toplevel() returns the
root window for that, which is wrong, so we check that explicitly.
2009-04-02 10:15:29 +02:00
Alexander Larsson
33c0c1fba8 Don't mess with any events on the root window.
This causes all sorts of weirdness with pointer_over_window
being the rootwindow and then crashing gdk_window_get_toplevel() later.

With this metacity stops crashing madly.
2009-04-02 10:15:29 +02:00
Alexander Larsson
6e56179b03 Don't crash if window->parent is NULL
This happens for events on the root window.
2009-04-02 10:15:28 +02:00
Alexander Larsson
de2d5f299d Simplify do_move_region_bits_on_impl by removing unused arguments 2009-04-02 10:15:28 +02:00
Alexander Larsson
b272456023 Remove unused label 2009-04-02 10:15:28 +02:00
Alexander Larsson
5ca1865f5d Don't ignore native CROSSING_GRAB/UNGRAB events
These are sent when someone else grabs the pointer, and we don't
want to miss these expose events. For instance, we missed enter
and leave events on alt-tab.

There were some issues with these wrt out-of-sync grab information
in the client, but that should now be handled. So, it should work
or at least be fixable if we find some bug.
2009-04-02 10:15:27 +02:00
Richard Hult
1a47356485 Remove invalidate_maybe_recurse and process_updates from the paintable interface
Replace them with two new functions
_gdk_windowing_{before,after}_process_all_updates() that are called
around the guts of gdk_window_process_all_updates(). Add empty ones
for X11 (nothing more needed), quartz ones will be implemented next.
2009-04-02 10:15:27 +02:00
Richard Hult
1ee03b35d0 Expose _gdk_window_process_updates_recurse for backends
We use this in the added windowing function
_gdk_windowing_window_process_updates_recurse. The X11 implementation
just calls _gdk_window_process_updates_recurse directly, but at least
quartz will need to do some more work.
2009-04-02 10:15:27 +02:00
Richard Hult
72d4403eed Add a window argument to begin_paint_region in the paintable interface
The paintable itself is now the impl window, which can be different
from the window.
2009-04-02 10:15:27 +02:00
Alexander Larsson
32a070d09a Fix gdk_window_has_no_impl typo 2009-04-02 10:15:26 +02:00
Alexander Larsson
ca1aeff814 Only set cursors on toplevel.
This fixes a problem where we used to set them on a native window, but we
never unset it becase when the pointer moved to another native window
we just set the cursor on that window. Always setting on the toplevel
fixes this.
2009-04-02 10:15:26 +02:00
Alexander Larsson
e24c9e291d Switch motion hint emulation to be serial based.
For backends not supporting serials, just have
_gdk_windowing_window_get_next_serial return zero.
2009-04-02 10:15:26 +02:00
Alexander Larsson
6a0d317866 Keep track of the impl windows wrapper directly with a ref
This is needed so that the ->wrapper of the impl window doesn't
go away while there are virtual windows referencing the impl
window.
2009-04-02 10:15:26 +02:00
Alexander Larsson
cf54a2c68e Ungrab keyboard if virtual window is hidden or destroyed 2009-04-02 10:15:26 +02:00
Alexander Larsson
cb05af0a61 Implement GDK_POINTER_MOTION_HINT_MASK support 2009-04-02 10:15:25 +02:00
Alexander Larsson
d267452bb7 New flicker flicker fixing approach
There was a performance problem with the old flicker fixing
approach. For moved windows we copied the window data to the double
buffer pixmap and then back to the window with the rest of the
expose data. In some cases the copy from window data to pixmap was
very slow because the pixmap was allocated in system memory and
the window in video memory.

The new approach is to delay all window moves and then replay them
after the expose has drawn to the double buffer pixmap but before
drawing it to the window. Furthermore, we remove all exposed areas
from the destination of the delayed moves so we won't copy something
just to then immediately draw over it.

This makes scrolling in firefox fast, and it makes tests/flicker not
show any (detectable) flicker.
2009-04-02 10:15:25 +02:00
Alexander Larsson
3155fdcd41 gdk_window_process_updates_internal only needs to flush outstanding moves 2009-04-02 10:15:25 +02:00
Alexander Larsson
4455db353f Split out the flushing of outstanding moves
Some places need to only flush the outstanding moves, split
this into gdk_window_flush_outstanding_move
2009-04-02 10:15:25 +02:00
Alexander Larsson
a9fd3ae249 Flush any outstanding stuff in the window in non-buffered get_internal_paint_info case
We return the raw window drawable, so its likely the app will do some
weird stuff to it, like draw using non-gdk operations. We don't want
the app to see any half-drawn state, so flush everything.

This fixes a scroll issue in firefox at least.
2009-04-02 10:15:25 +02:00
Alexander Larsson
815f0d7605 Clip exposed area to the visible region.
This avoids extra work, and it means we won't allocate large pixmaps
for double buffering.
2009-04-02 10:15:25 +02:00
Alexander Larsson
d82cee80c3 Don't send expose events if region is empty 2009-04-02 10:15:21 +02:00
Alexander Larsson
7cebc68bde Handle native children correctly in gdk_window_scroll
This is basically the same fix as was done for
gdk_window_move_resize_internal. We make sure not to move the native
child window contents twice and we don't copy data that was overwritten
by the moving of the native child windows.
2009-04-02 10:15:21 +02:00
Alexander Larsson
50d9a9018a Ifdef out x11 specific code 2009-04-02 10:15:21 +02:00
Alexander Larsson
e718893611 Fix performance issue with find_native_sibling_above
It keep recursing a lot, unnecessary
2009-04-02 10:15:20 +02:00
Alexander Larsson
1084b8e6a1 Call backend move_resize with the right coords/size
We calculated and set the new position and size, just pass that.
This avoids parsing the "special values" again
2009-04-02 10:15:20 +02:00
Alexander Larsson
905d328933 Make moving subwindows correctly handle native windows
Whenever a native window is moved this causes an immediate change in
the window (the window content is copied). This change conflicts can
conflict with outstanding moves or other cached changed, so we need
to flush all outstanding moves in the related windows.

To simplify the code for window move/resize the toplevel version was
split out to its own function.

Move native windows after recomputing so that we get the right new
shape before moving (and the implied copy). This means we're not
copying too much data.

Take into account the area of a moved window that contains native
subwindows, as these affect things in two ways:

First of all we shouldn't copy the original window location, as that
is copied by the native window move.

Secondly, we can't copy things  that would end up copying from the
native window move destination, as the data that used to be there is
now destroyed by the native window move.
2009-04-02 10:15:20 +02:00
Alexander Larsson
df4f4c14c7 do_move_region_bits_on_impl needs to copy from overlapping native windows too
It can happen that another native window is re-shaped over the region to
be moved, this will not destroy the data (since we're unsetting the background
when we reshape), but it will mean we need to read from this window.

We already used INCLUDE_INFERIORS, but that only handle subwindows. We fix
this by doing the copy on the toplevel, offsetting the copy to compensate for
this.
2009-04-02 10:15:20 +02:00
Alexander Larsson
6b15e248fa move_region_on_impl - shortcut if region is empty 2009-04-02 10:15:20 +02:00
Alexander Larsson
3c5c7f4b4d Avoid extending implicit paint size due to empty regions not working well with gdk_rectangle_union on clipbox 2009-04-02 10:15:20 +02:00
Alexander Larsson
ef3d1893b6 Always set the shape when creating a native window.
This is not always done by recompute_visible_regions, as
the clip region doesn't change.
2009-04-02 10:15:19 +02:00
Alexander Larsson
c967cabc35 Avoid lots of unnecessary computation when moving toplevel windows
There is no need to do all these computations when moving toplevels
as that can't really change any visible regions. Nor will it cause
any exposes we need to handle.
2009-04-02 10:15:19 +02:00
Alexander Larsson
cdb405dfcf Restack native window after reparent put it on top 2009-04-02 10:15:19 +02:00
Alexander Larsson
c1884ce403 Fix up native window handling in gdk_window_lower too 2009-04-02 10:15:19 +02:00
Alexander Larsson
28c4518cca Fix up gdk_window_raise and native window creation to not move native window above windows outside the non-native parent 2009-04-02 10:15:19 +02:00
Alexander Larsson
cce1ff8eb8 Move all backend specific raise/lower code into _internal helpers 2009-04-02 10:15:19 +02:00
Alexander Larsson
e918b64088 Make sure we handle clipping in gdk_window_draw_pixbuf if gc == NULL 2009-04-02 10:15:19 +02:00
Alexander Larsson
78bbac87ed Send expose events to exposed area when changing the window shape 2009-04-02 10:15:19 +02:00
Alexander Larsson
d6ecaca166 Handle GDK_WA_CURSOR in non-native window creation 2009-04-02 10:15:18 +02:00
Alexander Larsson
764ceead66 Include inferiors when moving window parts 2009-04-02 10:15:18 +02:00
Alexander Larsson
5378324a18 Ref imp even in non-native windows and don't NULL out in destroy so that get_screen works after destroy. 2009-04-02 10:15:18 +02:00
Alexander Larsson
40827b99db When creating native window, set the native background 2009-04-02 10:15:18 +02:00
Alexander Larsson
959d940812 Need to split up impl changing and reparenting so we can recompute abs_x/y inbetween 2009-04-02 10:15:17 +02:00
Alexander Larsson
c8bdac7508 Recompute abs_x/y before reparenting windows due to new native window parent 2009-04-02 10:15:17 +02:00
Alexander Larsson
acf1954f12 Don't destroy NULL region 2009-04-02 10:15:17 +02:00
Alexander Larsson
ed5564ee3a Ensure we show native window when creating them for already visible windows 2009-04-02 10:15:17 +02:00
Alexander Larsson
d73859fe16 Move native window showing/hiding out of is_impl, we may need to do this for emulated windows too 2009-04-02 10:15:17 +02:00
Alexander Larsson
9f2c97dd80 Ensure that we always invalidate newly exposed areas, as X may not (due to temp bg none) 2009-04-02 10:15:17 +02:00
Alexander Larsson
4a0cb4a240 Various fixes for native windows:
move_region_on_impl() - doesn't need to copy anything if dx/dy == 0
Ensure that we queue an update when invalidating an empty area but we have outstanding moves
Temporarily unset background when moving native child windows
2009-04-02 10:15:17 +02:00
Alexander Larsson
76e23f00da Update abs_x/y before moving native children 2009-04-02 10:15:17 +02:00
Alexander Larsson
4442463481 Move all native children (recursively) in gdk_window_scroll 2009-04-02 10:15:16 +02:00
Alexander Larsson
f6e1b0ac17 Ensure that we're properly hiding impl window if one of its parent non-impl windows are hidden
Also, add some debug printing code to list the GdkWindow tree
2009-04-02 10:15:16 +02:00
Alexander Larsson
a38e797941 Don't remove composited childrens area when processing updates
Handle shape when processing updates
Make sure we reset the old clips before setting new cairo clips
2009-04-02 10:15:16 +02:00
Alexander Larsson
890503099f Handle mask == NULL in shape_combine_mask 2009-04-02 10:15:16 +02:00
Alexander Larsson
d7e369c27a Implement input shapes 2009-04-02 10:15:16 +02:00
Alexander Larsson
4ba2b181bf Implement shaped windows 2009-04-02 10:15:16 +02:00
Alexander Larsson
062da50b9f Add _gdk_windowing_window_get_shape 2009-04-02 10:15:16 +02:00
Alexander Larsson
0d540e935b Create _gdk_drawable_create_cairo_surface to ugly typechecking 2009-04-02 10:15:15 +02:00
Alexander Larsson
0ba99e6e7b Make gdk_windowing_window_destroy a GdkWindowImpl method 2009-04-02 10:15:15 +02:00
Alexander Larsson
36ce54878b Make _gdk_windowing_window_queue_translation a GdkWindiwImpl call 2009-04-02 10:15:15 +02:00
Alexander Larsson
f22211c881 Remove unnecessary clear_area method in GdkWindowImpl 2009-04-02 10:15:15 +02:00
Alexander Larsson
d093be43e7 For implicit grabs, we grab the *event* window, not the pointer window 2009-04-02 10:15:15 +02:00
Alexander Larsson
83ee69740e Handle cursors right with grabs 2009-04-02 10:15:15 +02:00
Alexander Larsson
7b2b9a0219 Implement cursors 2009-04-02 10:15:15 +02:00
Alexander Larsson
f2b50ff638 Fix crossing event order and some details 2009-04-02 10:15:15 +02:00
Alexander Larsson
b771c9924d New approach to motion event handling 2009-04-02 10:15:11 +02:00
Alexander Larsson
afc81c9e64 gdk_window_draw_points() - make sure we use the offset points 2009-04-02 10:14:08 +02:00
Alexander Larsson
d74d94ce69 Implement flicker free handling of window moves/resizes 2009-04-02 10:14:08 +02:00
Alexander Larsson
5587130d48 Don't access event after freeing it 2009-04-02 10:14:08 +02:00
Alexander Larsson
1babb5400b Share the code to copy impl window regions w/ update_area 2009-04-02 10:14:08 +02:00
Alexander Larsson
dc0e339697 Don't actually clear background when mapped, as that causes ugly flashed. Just queue a repaint.
This is what the X backend does too.
2009-04-02 10:14:08 +02:00
Alexander Larsson
ee4211b9a8 Move flushing code to non-implicit-paint only call.
This is in preparation for other types of buffering
2009-04-02 10:14:08 +02:00
Alexander Larsson
62a52f8fd3 Don't include composited childen in window clip region, update region when setting composited 2009-04-02 10:14:08 +02:00
Alexander Larsson
191e8d1587 Ensure native window if composite requested 2009-04-02 10:14:08 +02:00
Alexander Larsson
a9ca08f6eb Don't draw on input_only windows 2009-04-02 10:14:07 +02:00
Alexander Larsson
bb709321f0 Store colormap on impl window (necessary for e.g. foreign windows) 2009-04-02 10:14:07 +02:00
Alexander Larsson
2fa6f32d8e When reparenting, remove from old parent before setting the new parent
(otherwise we remove from the wrong parent)
2009-04-02 10:14:07 +02:00
Alexander Larsson
533d3058b8 Fix some return value warnings 2009-04-02 10:14:07 +02:00
Alexander Larsson
ede9c2cf74 Handle gdk_window_get_impl_window on root window 2009-04-02 10:14:07 +02:00
Alexander Larsson
077eab6edf Clear to end of window if passing zero width or height to gdk_window_clear_area (fixes clist/ctree clearing) 2009-04-02 10:14:07 +02:00
Alexander Larsson
ec5d176278 Move gdk_window_get_deskrelative_origin to the GdkWindowImpl and make the common code handle abs_x/y 2009-04-02 10:14:07 +02:00
Alexander Larsson
891440d288 The double get_composite_drawable case can happen for pixmap targets too, so move the code to gdk_draw_drawable 2009-04-02 10:14:07 +02:00
Alexander Larsson
b6e84d3105 Fix draw_drawable being offset when using window as source (testgtk text test) 2009-04-02 10:14:07 +02:00
Alexander Larsson
c7554a2c76 Don't convert foreign windows to child when reparented to non-toplevel 2009-04-02 10:14:06 +02:00
Alexander Larsson
864649157d Move _gdk_gc_remove_drawable_clip from after each time its set to before each pixmap set and when adding a new different region
This means we can avoid changing the clip if we're drawing with the same gc to the same clip region
2009-04-02 10:14:06 +02:00
Alexander Larsson
e9ee842db1 Move drawable clip tracking into GdkGC 2009-04-02 10:14:06 +02:00
Alexander Larsson
5ff017e64e Move clip offsetting into _gdk_gc_intersect_clip_region 2009-04-02 10:14:06 +02:00
Alexander Larsson
47acf79494 Actually report x/y_root against the root window 2009-04-02 10:14:06 +02:00
Alexander Larsson
3a6d68e836 Add g_warning to not yet supported code 2009-04-02 10:14:05 +02:00
Alexander Larsson
aee3c571b0 Ensure we have native window before reparenting to toplevel 2009-04-02 10:14:05 +02:00
Alexander Larsson
f39bdc7e0f Make sure we change the event mask on native window if they change between toplevel and child 2009-04-02 10:14:05 +02:00
Alexander Larsson
07f76be87a Change assert to warning with some information 2009-04-02 10:14:05 +02:00
Alexander Larsson
346acdca54 Never set shapes on foreign windows 2009-04-02 10:14:05 +02:00
Alexander Larsson
ec4f8baa08 For foreign parents, use the real parent not the root (which is what we list as parent in the APIs) 2009-04-02 10:14:05 +02:00
Alexander Larsson
eabac453e6 Initial client-side-windows work
The history before this was kind of twisted as several different
approaches were tested, so that was all squashed into this initial
commit to hide the uninteresting changes and files that were later
removed.
2009-04-02 10:14:01 +02:00
Alexander Larsson
e2a2ba9d98 Revert patch that conflicts with client-side-windows work
Revert commit f4090b5c84, as that
conflicts with the client-side-windows work. Furthermore, that
change is already applied as part of the client-side-windows work.
2009-04-02 10:06:01 +02:00
Alexander Larsson
f4090b5c84 Bug 573087 – gdkwindow.c: {x,y}_offset used uninitialized
2009-03-02  Alexander Larsson  <alexl@redhat.com>

	Bug 573087 – gdkwindow.c: {x,y}_offset used uninitialized

	* gdk/gdkwindow.c (gdk_window_clear_backing_rect_redirect):
	Don't use uninitialized vars.
	Fix offsets for redirected pixmap, draw to pixmap not window.



svn path=/trunk/; revision=22441
2009-03-02 15:09:27 +00:00
Matthias Clasen
fd20c54e35 Revert an accidental commit
svn path=/trunk/; revision=22421
2009-02-28 05:28:47 +00:00
Matthias Clasen
d0e7f5889e Bug 573069 – Gdk-CRITICAL warnings with Gtk 2.14 when dragging
GtkNotebook tabs

        * gtk/gtkwidget.c (_gtk_widget_synthesize_crossing): Be a little
        more careful when navigating up the parent chain.

        * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Reset the
        pointer window thats stored on the screen when it is destroyed.


svn path=/trunk/; revision=22420
2009-02-28 05:24:07 +00:00
Matthias Clasen
379822c74b Use a different approach to snapshotting that is in line with what is done
* gtk/gtkwidget.c (gtk_widget_get_snapshot): Use a different approach
        to snapshotting that is in line with what is done in the client-side
        windows branch, and that works for widgets regardless if they are
        double-buffered or not. Patch by Alex Larsson.

        * gdk/gdkwindow.c (_gdk_window_calculate_full_clip_region): Clip
        to the parent.


svn path=/trunk/; revision=22187
2009-01-23 05:34:14 +00:00
Matthias Clasen
c98305ac00 Update docs on blank cursors
svn path=/trunk/; revision=22147
2009-01-20 02:27:57 +00:00
Christian Dywan
27d8d8ea2b Fail in gdk_window_new if _gdk_window_new failed
2009-01-09  Christian Dywan  <christian@imendio.com>

	Fail in gdk_window_new if _gdk_window_new failed

	* gdk/gdkwindow.c (gdk_window_new): Add g_return_val_if_fail
        in case _gdk_window_new is NULL. Approved by Tim Janik

svn path=/trunk/; revision=22082
2009-01-09 13:47:02 +00:00
Matthias Clasen
1934d3423b Fix a typo
svn path=/trunk/; revision=21877
2008-12-13 05:20:10 +00:00
Christian Dywan
c8392add22 Bug 539263 – Deprecate gdk_window_get_toplevels
2008-11-30  Christian Dywan  <christian@imendio.com>

	Bug 539263 – Deprecate gdk_window_get_toplevels

	* gdk/gdkwindow.c:
	* gdk/gdkwindow.h: Deprecate gdk_window_get_toplevels

svn path=/trunk/; revision=21831
2008-11-30 05:04:29 +00:00
Michael Natterer
6df89b0ad8 gdk/gdkdraw.c gdk/gdkimage.c gdk/gdkscreen.c replace assertions for obj !=
2008-10-21  Michael Natterer  <mitch@imendio.com>

	* gdk/gdkdraw.c
	* gdk/gdkimage.c
	* gdk/gdkscreen.c
	* gdk/gdkwindow.c: replace assertions for obj != NULL by
	GDK_IS_OBJ(), remove redundant != NULL checks when there is
	already a type check, add some g_return_if_fail() that were
	missing entirely, fix some broken indentation and spacing.


svn path=/trunk/; revision=21695
2008-10-21 21:42:39 +00:00
Matthias Clasen
07b6161995 More doc fixes
svn path=/trunk/; revision=21282
2008-09-04 04:32:30 +00:00
Torsten Schönfeld
016290b4e2 Fix small issues in the documentation of gdk_window_remove_redirection and
gdk_window_redirect_to_drawable.

svn path=/trunk/; revision=21137
2008-08-16 19:56:23 +00:00
Cody Russell
e7b024c6b7 Bug 541305 – [Win32] Scrolling was broken after GdkWindow refactoring
2008-07-02  Cody Russell  <bratsche@gnome.org>

        Bug 541305 – [Win32] Scrolling was broken after GdkWindow refactoring

        * gdk/win32/gdkwindow-win32.c:	Reverted	some logic so that scrolling
	works again.

        * gdk/win32/gdkgeometry-win32.c: Removed some more unnecessary	checks.
        * gdk/win32/gdkkeys-win32.c: Removed unused variable to fix compile-time
        warnings.


svn path=/trunk/; revision=20737
2008-07-02 20:22:30 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Michael Natterer
971023d922 Some unrelated cleanups found while reviewing the offscreen window patch:
2008-06-30  Michael Natterer  <mitch@imendio.com>

	Some unrelated cleanups found while reviewing
	the offscreen window patch:

	* gdk/gdkwindow.c: add missing Since: 2.14 to the redirection
	functions, fix some function header indentation, update
	documentation of redirect_to_drawable().

	* gdk/x11/gdkwindow-x11.c
	* gdk/x11/gdkpixmap-x11.c: fix function header
	formatting/indentation.

	* gtk/gtkwidget.c: use I_() on "damage_event".


svn path=/trunk/; revision=20708
2008-06-30 12:15:29 +00:00
Emmanuele Bassi
e27632cd6d Abstract some GdkWindow API into an interface that the backends must
2008-06-27  Emmanuele Bassi  <ebassi@gnome.org>

	Abstract some GdkWindow API into an interface that the backends
	must implement. (based on a patch by Alex Larsson)

	* gdk/Makefile.am: Add gdkwindowimpl.[ch]

	* gdk/gdk.symbols: Move symbols around.

	* gdk/gdkinternals.h:
	* gdk/gdkwindowimpl.[ch]: Move some of the GdkWindow API we require
	from the backends to a GInterface that the backends should implement
	instead.

	* gdk/gdkwindow.c: Provide some of the GdkWindow public API as a
	wrapper call around the GdkWindowImpl interface vtable.

	* gdk/x11/gdkevents-x11.c:
	* gdk/x11/gdkgeometry-x11.c:
	* gdk/x11/gdkprivate-x11.h:
	* gdk/x11/gdkwindow-x11.c:
	* gdk/x11/gdkwindow-x11.h: Update the X11 backend to implement
	the GdkWindowImpl interface.

svn path=/trunk/; revision=20695
2008-06-27 14:27:44 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Matthias Clasen
d0b1330d92 Fix doc typos
svn path=/trunk/; revision=20380
2008-06-13 17:20:55 +00:00
10:49:20 Tim Janik
4111cf2065 Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20  Tim Janik  <timj@imendio.com>

	* Applied pixmap redirection patch by Alexander Larsson with
	various updates from:
	Bug 318807 – Offscreen windows and window redirection.


	Updates:

	* updated docs to mention "Since 2.16".

	* tests/testgtk.c: fixed snapshooting pixmap leak.
	convert pixmap to pixbuf after snapshooting, to compensate for different
	bit depths (occurs when snapshooting ARGB visuals and displaying the
	pixmap in an RGB visual).

	* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.

	* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
	need for it. enqueue damage notification as GDK_DAMAGE events
	for each painting redirection at the start of the event queue.
	consider windows with a redirection fully visible when invalidating,
	and when updating from backing store. cleaned up stale variables.

	* gdk/gdkevents.c: added _gdk_event_queue_prepend().

	* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
	gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
	tree, drawingarea, text, handlebox, etc.
	clip the redirected window hierarchy to window sizes, the visible
	rectangles don't need to be taken into account here.
	extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
	in case pixmap visuals could mismatch.

	* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().


	Base patch:

	* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
	of possibly obscured widgets into an offscreen pixmap.

	* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
	gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.

	* gtk/gtkmain.c: dispatch GDK_DAMAGE events.

	* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
	implementations here, adapted them to propagate redirects to child windows.
	gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
	clipped to visible region. queue GDK_DAMAGE event delivery.
	gdk_window_redirect_to_drawable(): install window painting redirection.
	gdk_window_remove_redirection(): remove previously installed redirection.

	* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
	renamed _gdk_window_new() and _gdk_window_reparent().

	* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
	gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().

	* gdk/gdkevents.h: added GDK_DAMAGE event type.

	* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.

	* gdk/gdkinternals.h: added internal prototypes.



svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
Michael Natterer
92f86e0496 gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h
2008-01-14  Michael Natterer  <mitch@imendio.com>

	* gdk/gdk.h
	* gdk/gdkcairo.h
	* gdk/gdkcolor.h
	* gdk/gdkgc.h
	* gdk/gdkinternals.h
	* gdk/gdkregion.h
	* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
	parameters const.

	* gdk/gdkcairo.c
	* gdk/gdkgc.c
	* gdk/gdkwindow.c
	* gdk/gdkrectangle.c
	* gdk/gdkpolyreg-generic.c
	* gdk/gdkregion-generic.c
	* gdk/directfb/gdkcolor-directfb.c
	* gdk/directfb/gdkgc-directfb.c
	* gdk/directfb/gdkgeometry-directfb.c
	* gdk/directfb/gdkwindow-directfb.c
	* gdk/quartz/gdkcolor-quartz.c
	* gdk/quartz/gdkgc-quartz.c
	* gdk/quartz/gdkgeometry-quartz.c
	* gdk/quartz/gdkwindow-quartz.c
	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkgeometry-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c
	* gdk/x11/gdkcolor-x11.c
	* gdk/x11/gdkgc-x11.c
	* gdk/x11/gdkgeometry-x11.c
	* gdk/x11/gdkmain-x11.c
	* gdk/x11/gdkprivate-x11.h
	* gdk/x11/gdkwindow-x11.c: changed accordingly.

	* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
	headers.


svn path=/trunk/; revision=19365
2008-01-14 14:02:12 +00:00
Kristian Rietveld
50a766c95f guard for windows with GDK_WINDOW_DESTROYED set. (Fixes #482531, reported
2007-11-09  Kristian Rietveld  <kris@imendio.com>

	* gdk/gdkwindow.c (gdk_window_process_all_updates): guard for
	windows with GDK_WINDOW_DESTROYED set.  (Fixes #482531, reported
	by Sebastien Bacher).


svn path=/trunk/; revision=18975
2007-11-09 22:44:31 +00:00
Kristian Rietveld
eab3ef3145 Fixes #426246.
2007-09-12  Kristian Rietveld  <kris@imendio.com>

	Fixes #426246.

	* gdk/gdk.symbols:
	* gdk/gdkwindow.[ch]
	(gdk_window_freeze_toplevel_updates_libgtk_only),
	(gdk_window_thaw_toplevel_updates_libgtk_only): new functions
	to freeze a toplevel window and all its descendants.  To be made
	public in 2.14,
	(gdk_window_schedule_update): return if toplevel is frozen,
	(gdk_window_process_all_updates): defer processing updates if toplevel
	is frozen.

	* gtk/gtkwindow.c (gtk_window_configure_event): directly size
	allocate for override redirect windows, freeze toplevel and
	descendants otherwise and wait until resizing is done.


svn path=/trunk/; revision=18802
2007-09-12 17:13:24 +00:00
Behdad Esfahbod
69cce50cd0 Revert commit that was accidentally made. Sorry.
svn path=/trunk/; revision=18596
2007-08-08 22:30:26 +00:00
Behdad Esfahbod
398a61e43d Use gtk_true instead of rolling a new one. Patch from Xan Lopez.
2007-08-08  Behdad Esfahbod  <behdad@gnome.org>

        * gdk/gdkwindow.c (gdk_window_invalidate_region): Use gtk_true
        instead of rolling a new one.  Patch from Xan Lopez.


svn path=/trunk/; revision=18595
2007-08-08 22:25:58 +00:00
Ryan Lortie
f0cfba930c add note that the semantics of this call, when mixed with the new
2007-07-20  Ryan Lortie  <desrt@desrt.ca>

        * gtk/gtkwidget.c (gtk_widget_is_composited): add note that the
        semantics of this call, when mixed with the new
        gdk_window_set_composited(), will change in the future.

        * gdk/x11/gdkevents-x11.c (gdk_event_translate): only grab Damage
        events that belong to us.


svn path=/trunk/; revision=18506
2007-07-19 23:50:39 +00:00
Tim Janik
2af3c53e47 docu fixup by Bjoern Lindqvist, #454703.
Sun Jul  8 01:33:45 2007  Tim Janik  <timj@gtk.org>

        * gdk/gdkwindow.c: docu fixup by Bjoern Lindqvist, #454703.



svn path=/trunk/; revision=18398
2007-07-07 23:36:33 +00:00
Behdad Esfahbod
1adaeba11f Improve docs. (#446138, Björn Lindqvist)
2007-06-12  Behdad Esfahbod  <behdad@gnome.org>

        * gdk/gdkwindow.c (gdk_window_get_pointer): Improve docs.
        (#446138, Björn Lindqvist)


svn path=/trunk/; revision=18109
2007-06-12 05:34:26 +00:00
Matthias Clasen
0f4d0f8e62 2.11.1
svn path=/trunk/; revision=18027
2007-06-04 17:01:14 +00:00
Matthias Clasen
885ba04648 Add support for composited child windows. (#412882, Ryan Lortie)
2007-06-01  Matthias Clasen  <mclasen@redhat.com>

        Add support for composited child windows.  (#412882, Ryan Lortie)

        * gdk/gdk.symbols:
        * gdk/gdkdisplay.h:
        * gdk/gdkinternals.h:
        * gdk/gdkwindow.[hc]: Add gdk_display_supports_composite() and
        gdk_window_set_composited().

        * gdk/x11/gdkevents-x11.c:
        * gdk/x11/gdkdisplay-x11.[hc]:
        * gdk/x11/gdkwindow-x11.[hc]: X11 implementation.

        * gdk/win32/gdkdisplay-win32.c:
        * gdk/win32/gdkwindow-win32.c: Dummy win32 implementration.

        * gdk/quartz/gdkdisplay-quartz.c:
        * gdk/quartz/gdkwindow-quartz.c: Dummy Quartz implementation.

        * gdk/directfb/gdkdisplay-directfb.c:
        * gdk/directfb/gdkwindow-directfb.c: Dummy DirectFB implementation.

        * tests/testgtk.c: Add a "composited window" test.


svn path=/trunk/; revision=18004
2007-06-01 12:16:12 +00:00
Matthias Clasen
abaed38888 Doc improvements
svn path=/trunk/; revision=17496
2007-03-12 06:26:34 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00
Matthias Clasen
788b391cef Reduce locking overhead by not repeatedly getting the paintable iface.
2007-01-25  Matthias Clasen  <mclasen@redhat.com>

        * gdk/gdkwindow.c: Reduce locking overhead by not repeatedly getting
        the paintable iface.



svn path=/trunk/; revision=17213
2007-01-25 14:24:53 +00:00
Behdad Esfahbod
b4328913d8 Avoid overflow when converting coordinates to Pango units. (#332266, Jody
2007-01-05  Behdad Esfahbod  <behdad@gnome.org>

        * gdk/gdkprivate.h:
        * gdk/gdkpango.c (gdk_draw_layout_line_with_colors),
        (gdk_draw_layout_with_colors):
        * gdk/gdkwindow.c (gdk_window_draw_glyphs_transformed):
        Avoid overflow when converting coordinates to Pango units. (#332266,
        Jody Goldberg)


svn path=/trunk/; revision=17075
2007-01-05 06:16:32 +00:00
Matthias Clasen
721c3bc101 Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.
2006-12-22 19:10:43 +00:00
Matthias Clasen
241ff0b6bd Cleanups 2006-10-08 05:32:07 +00:00
Matthias Clasen
70ae6a0e83 Apply a patch by Behdad Esfahbod to reduce relocations. (#359053)
2006-10-03  Matthias Clasen  <mclasen@redhat.com>

        * gtk/*.c, gdk/*.c: Apply a patch by Behdad Esfahbod to
        reduce relocations. (#359053)
2006-10-03 15:54:52 +00:00
Matthias Clasen
5175386051 Add some more detail to the docs. (#311399, Nikos Kouremenos)
2006-07-17  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkwindow.c (gdk_window_get_pointer): Add some more
	detail to the docs.  (#311399, Nikos Kouremenos)
2006-07-17 04:19:59 +00:00
Matthias Clasen
7b12fdbc2a Don't use G_DEFINE_TYPE, since the instance struct name does not match the
2006-05-30  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkpixmap.c:
	* gdk/gdkwindow.c: Don't use G_DEFINE_TYPE, since the instance
	struct name does not match the type name.  (#343453, Ed Catmur)
2006-05-31 03:34:04 +00:00
Matthias Clasen
f22387f042 Remove extraneous ; 2006-05-14 03:58:06 +00:00
Matthias Clasen
8db728f953 fix docs 2006-05-07 03:28:22 +00:00
Anders Carlsson
47257b075b Add new GdkPaintable interface which implementation objects can implement
2006-04-11  Anders Carlsson  <andersca@imendio.com>

        * gdk/gdkinternals.h:
        * gdk/gdkwindow.c:
        (_gdk_paintable_get_type):
        (gdk_window_begin_paint_region):
        (gdk_window_end_paint):
        (gdk_window_process_updates):
        (gdk_window_invalidate_maybe_recurse):
        Add new GdkPaintable interface which implementation objects can
        implement in order to override gdk painting functions.
2006-04-10 19:43:08 +00:00
Matthias Clasen
10f0736ac7 Use G_DEFINE_TYPE.
2006-04-04  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkdisplay.c:
	* gdk/gdkdisplaymanager.c:
	* gdk/gdkdraw.c:
	* gdk/gdkkeys.c:
	* gdk/gdkpixmap.c:
	* gdk/gdkscreen.c:
	* gdk/gdkwindow.c:
	* gdk/x11/gdkcolor-x11.c:
	* gdk/x11/gdkdisplay-x11.c:
	* gdk/x11/gdkdnd-x11.c:
	* gdk/x11/gdkdrawable-x11.c:
	* gdk/x11/gdkgc-x11.c:
	* gdk/x11/gdkimage-x11.c:
	* gdk/x11/gdkinput.c:
	* gdk/x11/gdkpixmap-x11.c:
	* gdk/x11/gdkscreen-x11.c:
	* gdk/x11/gdkwindow-x11.c: Use G_DEFINE_TYPE.

	* gdk/x11/gdkcolor-x11.c:
	* gdk/x11/gdkdnd-x11.c:
	* gdk/x11/gdkimage-x11.c: Use instance private data.
2006-04-04 14:02:03 +00:00
Federico Mena Quintero
9bfabba034 Work around https://bugs.freedesktop.org/show_bug.cgi?id=4320, which used
2006-02-03  Federico Mena Quintero  <federico@ximian.com>

	Work around https://bugs.freedesktop.org/show_bug.cgi?id=4320,
	which used to be our own
	http://bugzilla.gnome.org/show_bug.cgi?id=314616.  If one uses a
	pixmap for a pattern in Cairo, and sets the pattern to
	CAIRO_EXTEND_REPEAT; and if the destination surface is also a
	pixmap, Cairo does a slow copy instead of using XCopyArea().  So,
	we use the same code that we used in GTK+ 2.6 (pre-cairo), by
	filling the double-buffer pixmap with a tiled GC and
	XFillRectangle().

	* gdk/gdkwindow.c (BackingRectMethod): New structure with a
	cairo_t and a GdkGC field.  Depending on which of these fields
	gets filled in, we'll use Cairo or GDK to clear the double-buffer
	pixmap when painting a window.
	(setup_backing_rect_method): Fill a BackingRectMethod as
	appropriate, depending on the window's configuration and our
	knowledge of whether Cairo is fast or slow when doing repeating
	patterns.
	(gdk_window_clear_backing_rect): Call
	setup_backing_rect_method().  Depending on what it returns, use
	Cairo to clear the double-buffer pixmap, or plain GDK.
2006-02-03 21:17:34 +00:00
Michael Natterer
8bdc0bf97c Applied patch from maemo-gtk that addresses many issues wrt display
2005-11-10  Michael Natterer  <mitch@imendio.com>

	Applied patch from maemo-gtk that addresses many issues wrt
	display migration and display closing (bug #85715).

	* gdk/gdkdisplay.c (gdk_display_dispose): don't just set the
	default display to NULL when it's closed. Instead set the most
	recently opened display as new default (if one exists).

	* gdk/gdkpango.c (on_renderer_display_closed): fixed signature
	of this callback.

	* gdk/gdkscreen.c (gdk_screen_dispose): check if the GCs still
	exist before unrefing them.

	* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): if the screen
	is closed, allow destruction of the root window.

	* gdk/x11/gdkdisplay-x11.c: moved some stuff from finalize() to
	dispose(), free stuff that was leaked before.

	* gdk/x11/gdkevents-x11.c (_gdk_x11_events_uninit_screen): check if
	the xsettings_client still exists before destroying it.

	* gdk/x11/gdkkeys-x11.c: added finalization and free the allocated
	X resources.

	* gdk/x11/gdkpixmap-x11.c: moved stuff from finalize() to new
	dispose() implementation.

	* gdk/x11/gdkscreen-x11.c: moved stuff from finalize() to
	dispose() and check if it still exists before unrefing it. Set
	their pointers to NULL/None *after* upchaining in dispose(),
	because X11 implementations of members of the parent class still
	need them for their own destruction.

	* gdk/x11/gdkvisual-x11.c: removed finalize() implementation which
	was g_error()ing when finalizing a visual.

	* gtk/gtkclipboard.c (gtk_clipboard_finalize): don't use
	get_clipboard_widget() because it would create the widget if it
	doesn't exist. Use g_object_get_data() directly instead.

	* gtk/gtktextdisplay.c (on_renderer_display_closed): fixed signature
	of this callback.
2005-11-10 12:09:42 +00:00
Matthias Clasen
4401280405 Fix #316871, reported by Dan Winship:
2005-09-26  Matthias Clasen  <mclasen@redhat.com>

	Fix #316871, reported by Dan Winship:

	* gdk/gdkwindow.h (struct _GdkWindowObject): Add a shaped flag.

	* gdk/x11/gdkwindow-x11.c (gdk_window_shape_combine_mask)
	(gdk_window_shape_combine_region): Set it here.

	* gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't
	remove the child area for shaped windows.
2005-09-26 20:27:44 +00:00
Matthias Clasen
476e138db0 Intern type names before registering the type to avoid unnecessary copies.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_type):
	* gdk/x11/gdkscreen-x11.c (_gdk_screen_x11_get_type):
	* gdk/x11/gdkpixmap-x11.c (gdk_pixmap_impl_x11_get_type):
	* gdk/x11/gdkkeys-x11.c (gdk_keymap_x11_get_type):
	* gdk/x11/gdkinput.c (gdk_device_get_type):
	* gdk/x11/gdkimage-x11.c (gdk_image_get_type):
	* gdk/x11/gdkgc-x11.c (_gdk_gc_x11_get_type):
	* gdk/x11/gdkdrawable-x11.c (_gdk_drawable_impl_x11_get_type):
	* gdk/x11/gdkdnd-x11.c (gdk_drag_context_get_type):
	* gdk/x11/gdkdisplay-x11.c (_gdk_display_x11_get_type):
	* gdk/x11/gdkcolor-x11.c (gdk_colormap_get_type):
	* gdk/gdkwindow.c (gdk_window_object_get_type):
	* gdk/gdkscreen.c (gdk_screen_get_type):
	* gdk/gdkrectangle.c (gdk_rectangle_get_type):
	* gdk/gdkpixmap.c (gdk_pixmap_get_type):
	* gdk/gdkkeys.c (gdk_keymap_get_type):
	* gdk/gdkfont.c (gdk_font_get_type):
	* gdk/gdkevents.c (gdk_event_get_type):
	* gdk/gdkdraw.c (gdk_drawable_get_type):
	* gdk/gdkdisplaymanager.c (gdk_display_manager_get_type):
	* gdk/gdkdisplay.c (gdk_display_get_type):
	* gdk/gdkcursor.c (gdk_cursor_get_type):
	* gdk/gdkcolor.c (gdk_color_get_type): Intern type names before
	registering the type to avoid unnecessary copies.
2005-08-31 15:14:26 +00:00
Owen Taylor
b1df326ab3 Remove superfluous call to gdk_window_get_offsets (). (#313051, Bertram
2005-08-09  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkwindow.c (gdk_window_ref_cairo_surface): Remove superfluous
        call to gdk_window_get_offsets (). (#313051, Bertram Felgenhauer)
2005-08-10 02:40:10 +00:00
Matthias Clasen
15161e3a11 Update all fields 2005-06-16 05:18:33 +00:00
Matthias Clasen
f1a4c08002 Adjust offsets when recursing. (#153682, Felipe Heidrich)
2005-05-17  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_bg_pattern): Adjust offsets
	when recursing.  (#153682, Felipe Heidrich)
2005-05-17 05:17:08 +00:00
Owen Taylor
dda40ca71a Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to
2005-05-11  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea
	to draw the swatch in to avoid having an extraneous window.

	* gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe
	color when !has_opacity.

2005-05-10  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source
	files for Cairo convenience functionality.

	* gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a
	convenience functions to add GdkRectangle, GdkRegion to a cairo path.

	* gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c
	gtk/gtkstyle.c: Use gdk_cairo_rectangle/region().

	* gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename
	gdk_drawable_create_cairo_context() to gdk_cairo_create().

	* gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c:
	Rename gdk_pixbuf_set_as_cairo_source() to
	gdk_cairo_set_source_pixbuf().

	* gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c
	gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c:
	Adjust for renames.

	* gdk/gdk.symbols: Update.

	* gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix
	coordinate system problem that was causing the wrong portions
	to be invalidated.

	* gtk/gtkcellrenderer.c (gtk_cell_renderer_render)
	gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render)
	gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render)
	gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render)
	gtk/gtkcellview.c (gtk_cell_view_expose)
	gtk/gtkdnd.c (gtk_drag_highlight_expose)
	gtk/gtkentry.c (gtk_entry_draw_text)
	gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization.

	* gtk/gtkcalendar.[ch]: Beat into something roughly resembling
	GTK+ style ... use instance-private data and standard names for
	private structure, etc. Move function docs inline.

	* gtk/gtkcalendar.[ch]: Switch to drawing everything in
	expose. Switch drawing to Cairo.

	* gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate
	gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
Owen Taylor
274e49f37e Change prototype to match cairo_set_source_surface().
2005-05-07  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkpixbuf-render.c gdk/gdkpixbuf.h (gdk_pixbuf_set_as_cairo_source):
        Change prototype to match cairo_set_source_surface().

        * gdk/gdkdraw.c gdk/gdkgc.c gdk/gdkpixbuf-render.c gdk/gdkwindow.c
        gtk/gtkhsv.c tests/testcairo.c.
2005-05-07 18:51:18 +00:00
Owen Taylor
788bbf520a Add a draw-border style property to allow themes to draw outside the
2005-04-28  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c: Add a draw-border style property to allow
	themes to draw outside the widget's allocation.

	* gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs
	that were working around the clip-leakage bug in Cairo.

	* gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than
	save/fill/restore.

	* gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context()
	That updates a Cairo context to match a GC.

	* gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support
	for tiles/stipples/clipping to gdk_draw_glyphs(),
	gdk_draw_trapezoids().

	* gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal
	implementation of stipples. Use one cairo_t across the entire
	drawing operation. Replace cairo_matrix_create() with
	stack-allocated matrices.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c: Save various aspects of the
	GC state (fill, tile, stipple, foreground, background, clip region)
	in instance-private-data for future use. Add getters.
	Get rid of _gdk_windowing_gc_get_foreground() function implemented
	by the backends.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add
	_gdk_gc_init() to do initial setup of the GC from values;
	fixes some problems from drawable redirection.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move
	gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into
	the generic code, add _gdk_windowing_gc_copy(),
	_gdk_windowing_gc_set_clip_region() to do backend specific
	stuff.

	* gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
	gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
	gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}:
	Don't duplicate state that now is stored by the generic code.

	* gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
Owen Taylor
9725c8d752 gtk/gtkstyle.c gtk/gtkcolorsel.c gtk/gtkhsv.c gtk/gtkiconview.c Update to
2005-04-18  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkstyle.c gtk/gtkcolorsel.c gtk/gtkhsv.c gtk/gtkiconview.c
        * gdk/gdkcolor.c gdk/gdkwindow.c gdk/gdkpixbuf-render.c
        gdk/gdkpango.c tests/testcairo.c: Update to new Cairo API for
        setting color and opacity. (#301066, Vincent Noel)
2005-04-18 15:11:01 +00:00
Søren Sandmann
8e5713f3e0 Don't invalidate areas that are covered by mapped input-output child
Mon Mar 28 15:13:42 2005  Søren Sandmann  <sandmann@redhat.com>

	* gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't
	invalidate areas that are covered by mapped input-output child
	windows. Bug 141380.
2005-03-28 20:28:43 +00:00
Owen Taylor
368f15ca59 Use cairo_set_device_offset().
2005-02-24  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: Use cairo_set_device_offset().

	* gdk/win32/gdkdrawable-win32.[ch] gdk/win32/gdkwindow-win32.c
	gdk/win32/gdkpixmap-win32.c:
	Add_gdk_win32_drawable_acquire/release_dc() to get a DC for the
	drawable. Add _gdk_drawable_win32_finish() to clean up resources
	when a drawable is destroyed.

	* gdk/win32/gdkgc-win32.c gdk/win32/gdkdrawable-win32.c
	(blit_from_pixmap) gdk/win32/gdkprivate-win32.h : Use
	acquire/release_dc when getting a DC to use with a GC or for
	blitting from a pixmap.

	* gdk/win32/gdkdrawable-win32.[ch]: Implement ref_cairo_surface()

	* gdk/win32/gdkpango-win32.c gdk/win32/gdkdrawable-win32.c Makefile.am:
	Remove gdk_screen_get_pango_context(), draw_glyph[_transformed]
	implementations.

	* gdk/win32/gdkdrawable-win32.c: Remove
	gdk_draw_rectangle_alpha_libgtk_only()
2005-03-18 01:23:23 +00:00
Owen Taylor
09d7eafb15 Switch set_cairo_target() virtual function to ref_cairo_surface()
2005-03-15  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkpixmap.c gdk/gdkwindow.c
	gdk/x11/gdkdrawable-x11.c gdk/x11/gdkpixmap-x11.c gdk/x11/gdkwindow-x11.c
	gdk/gdkinternals.h: Switch set_cairo_target() virtual function to
	ref_cairo_surface()

	* gdk/gdkdrawable.h gdk/gdkdraw.h: Switch set_cairo_target() virtual
	function to create_cairo_context()

	* gdk/gdkwindow.c: Clear double buffer pixmaps with Cairo.

	* gdk/x11/gdkwindow-x11.c: Keep all components in GdkWindowObject.bg_color,
	not just the pixel.

	* tests/testcairo.c: Update for create_cairo_context()

	* gdk/gdkdraw.c (gdk_draw_trapezoids, gdk_draw_glyphs[_transformed]):
	Reimplement in terms of Cairo, bypass the vtable entries.

	* gdk/x11/gdkdrawable-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
	gdk/x11/gdkgc-x11.c gdk/x11/gdkpango-x11.c
	gdk/x11/gdkprivate-x11.h gdk/x11/Makefile.am: Remove
	implementation of draw_trapezoids / draw_glyphs[_transformed].

	* gdk/gdkpango.c: Switch GdkPangoRenderer to use Cairo

	* gdk/gdkpango.c gdk/x11/gdkpango-x11.c: Move
	gdk_pango_context_get_for_screen() into the backend independent code.

	* gdk/x11/gdkdrawable-x11.[ch]: Remove Xft use, use RENDER directly
	for drawing images.

	* gdk/gdkdrawable.h gdk/x11/gdkdrawable-x11.c: Remove
	gdk_draw_rectangle_alpha_libgtk_only.

	* gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c: Add
	gdk_pixbuf_set_as_cairo_source()

	* gdk/gdk.symbols: Update

	* gtk/gtkcolorsel.c gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkruler.[ch]
	gtk/gtk[hv]ruler.c: Convert to Cairo rendering.

	* gtk/gtkstyle.c (gtk_default_draw_check, gtk_default_draw_focus,
	gtk_default_draw_option): Switch to Cairo. Simplify the checkbutton,
	radio button style for now to get something more scalable.

	*  gtk/gtksettings.c: #if 0 out the code to use PangoXft for hinting/
	antialiasing/dpi settings.
2005-03-17 01:54:40 +00:00
Matthias Clasen
2a2d769d42 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-15  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gdk/gdk.symbols: Group symbols by header and source file.
	* gdk/makegdkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegdkalias.pl -def
	* gdk/Makefile.am (gdkaliasdef.c): Add a rule to generate this
	file.
	* gdk/*.c, gdk/x11/*.c: Include gdkalias.h after the other
	headers, include gdkaliasdef.c at the bottom.
2005-03-16 03:17:27 +00:00
Owen Taylor
93344f6dfe Add gdk_drawable_set_cairo_target().
2005-02-03  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkdrawable.[ch] gdkpixmap.c gdkwindow.c: Add
        gdk_drawable_set_cairo_target().

        * tests/testtreeflow.c (enum): Use grand not rand as a variable
        name because one of the cairo headers is pulling in stdlib.h.

        * tests/testcairo.c tests/Makefile.am: Add a simple cairo based
        example.

        * configure.in: Bump release to 2.7.0, gtk_binary_version to 2.7.0.

        * Require libpangocairo for all backends.
2005-02-03 23:29:02 +00:00
Søren Sandmann
63f2fd9614 Add sensitivity-changing timeout. Written by Christian Persch.
Wed Dec 22 14:22:19 2004  Søren Sandmann  <sandmann@redhat.com>

	* tests/testtoolbar.c (timeout_cb): Add sensitivity-changing
	timeout. Written by Christian Persch.

Wed Dec 22 14:14:02 2004  Søren Sandmann  <sandmann@redhat.com>

	Bug #161561

	* gdk/x11/gdkwindow-x11.c (tmp_{re,un}set_bg): Only set/reset the
	background for windows that get expose events.

	* gdk/gdkwindow.c (gdk_window_process_updates_internal): Remove
	hack to repaint !expose windows.
2004-12-22 19:25:24 +00:00
Owen Taylor
3d737ee8ba Add GdkPangoRenderer, a subclass of PangoRenderer targeting GDK drawables.
Sat Nov 20 15:13:51 2004  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpango.[ch]: Add GdkPangoRenderer, a subclass of
	PangoRenderer targeting GDK drawables. Use to implement the old
	gdk_draw_layout() and friends.

	* gdk/gdkdraw.c gdk/gdkdrawable.h gdk/gdkwindow.c gdk/gdkpixmap.c:
	Add gdk_draw_glyphs_transformed() gdk_draw_trapezoids() and
	the corresponding members of GdkDrawableClass. Add a fallback
	implementation of gdk_draw_trapezoids() in terms of pixbufs.

	* gdk/gdkwindowing.h gdk/x11/gdkg-x11.h: Add
	_gdk_windowing_gc_get_foreground() to enable the fallback
	trapezoid implementation.

	* gdk/x11/gdkdrawable-x11.c gdk/x11/gdkdisplay-x11.h: Implement
	draw_glyph_transformed,	draw_trapezoids.

	* gdk/x11/gdkdrawable-x11.[ch]: Add
	_gdk_x11_drawable_draw_xtrapezoids, _gdk_x11_drawable_draw_xft_glyphs
	for use of GdkX11Renderer.

	* gdk/x11/gdkgc-x11.c gdk/x11/gdkprivate-x11.h: Implement
	GDK_TILED, GDK_STIPPLED, GDK_OPAQUE_STIPPLED in the RENDER codepath.

	* gdk/gdkpango-x11.c: Add GdkX11Renderer... a subclass of
	PangoXftRenderer that does tiles/stipples and fallback rendering
	of trapezoids without the RENDER extension.

	* gdk/gdkpango-x11.c gdk/x11/gdkscreen-x11.[ch] _gdk_x11_renderer_get:
	Add _gdk_x11_renderer_get() to get a singleton GdkX11Renderer
	for the screen.

	* gdk/x11/gdkdrawable-x11.c (get_impl_drawable): Fix a None/NULL
	confusion.

	* gtk/gtklabel.[ch] gtk/gtk.symbols: Add gtk_label_set/get_angle(),
	and an ::angle property.

	* gtk/gtklabel.c: Remove #if 0'd dead code gtk_label_paint_word().

	* gtk/gtktextdisplay.c: Switch to using a GtkTextRenderer subclass
	of GdkPangoRenderer for drawing.

	* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Switch to using
	gtk_attr_shape_new_with_data() to store backreferences to
	embedded pixmaps and widgets. Leave line_display->shaped_objects
	around for backwords compatibility.

	* gdk/gdkpango.[ch] (gdk_pango_context_set_colormap): Describe
	as deprecated, remove implementation.

	* gtk/gtkwidget.c (gtk_widget_create_pango_context): Remove
	call to gdk_pango_context_set_colormap.

	* demos/gtk-demo/Makefile.am demos/gtk-demo/rotated_text.c: Add
	a demo showing drawing rotated text.

	* tests/testgtk.c: Add a rotated-label test, and also a rotated
	drawing test (differs from demos/gtk-demo/rotated_text by also
	using a tile)
2004-11-21 16:24:01 +00:00
4
2183dbf3c1 check the iteration window variable, not just the window passed in. fixes
Wed Oct  6 00:45:04 2004    <timj@birnet.org>

        * gdk/gdkwindow.c (gdk_window_is_viewable): check the iteration window
        variable, not just the window passed in. fixes #145270.
2004-10-05 23:05:13 +00:00
Matthias Clasen
c429b89d56 Make gdk_window_process_[all]_updates() respect update_freeze_counter
2004-08-26  Matthias Clasen  <mclasen@redhat.com>

	Make gdk_window_process_[all]_updates() respect
	update_freeze_counter  (#144272, Soeren Sandmann)

	* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
	install an idle for gdk_window_update_idle() if one isn't there
	already.
	(gdk_window_process_all_updates):
	(gdk_window_process_updates): Only process the updates if the
	window isn't frozen.
	(gdk_window_invalidate_maybe_recurse): Schedule an update when
	necessary.
	(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
	of directly installing the idle.
2004-08-26 14:09:08 +00:00
Matthias Clasen
0742ff3ae3 Add hidden aliases for exported symbols which are used internally in order
Mon Aug  9 15:41:17 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gdk/Makefile.am: Add rules to generate gdk.def and
	gdkalias.h from gdk.symbols, and make make check check
	the abi with abicheck.sh.

	* gdk/gdk.symbols: New file. Definition of the GDK ABI.
	The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gdk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgdk-x11.2.0.so against the symbols
	found in gdk.symbols.

	* gdk/makegdkalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* gdk/*.c, gdk/x11/*.c: Include gdkalias.h
2004-08-09 20:14:43 +00:00
Soeren Sandmann
dddab53b54 Do an empty begin_paint_region()/end_paint() for windows without
Tue Jul 13 00:40:29 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gdk/gdkwindow.c (gdk_window_process_updates_internal): Do an
	empty begin_paint_region()/end_paint() for windows without
	EXPOSURE_MASK.

	* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_tmp_unset_bg,
	_gdk_x11_window_tmp_reset_bg): Remove checks for EXPOSURE_MASK.
2004-07-12 22:52:40 +00:00
Owen Taylor
ef5915da35 Make this a total no-op when the new or old parent is destroyed. (#134230,
Sat Mar 13 12:17:16 2004  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Make
        this a total no-op when the new or old parent is
        destroyed. (#134230, patch from Soeren Sandmann)

        * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy):
        For foreign windows in our heirarchy, call
        _gdk_windowing_window_destroy_foreign (window) and skip
        all the normal destruction logic.

        * gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c:
        Move code to request destruction of a foreign window
        code into a separate _gdk_windowing_window_destroy_foreign().

        * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_finalize):
        Call GDK_WINDOW_DISPLAY() on the wrapper not on the
        impl. (Also from Soeren's patch)
2004-03-13 18:27:56 +00:00
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Soeren Sandmann
b69a67119c Use a scratch GC in the case where the background is a solid color.
Wed Feb 18 17:53:27 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gdk/gdkwindow.c (gdk_window_get_bg_gc): Use a scratch GC in the
	case where the background is a solid color.
	(gdk_window_clear_backing_rect): Reset the clip region after use.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_threshold_alpha): Go
	back to using a scratch GC. Pointed out by Owen Taylor

	* gdk/gdkdraw.c (gdk_drawable_real_draw_pixbuf): Only use a
	scratch GC if the passed-in one is NULL
2004-02-18 17:03:46 +00:00
Soeren Sandmann
f539d99334 Reset clip region back to NULL on cached GC (rest of #134728)
Wed Feb 18 14:27:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gdk/gdkwindow.c (gdk_window_get_composite_drawable): Reset clip
	region back to NULL on cached GC (rest of #134728)
2004-02-18 13:52:12 +00:00
Soeren Sandmann
df434db70e Fix bug reported by Nam SungHyun.
Wed Feb 18 13:28:57 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Fix bug reported by Nam SungHyun.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_threshold_alpha):
	Don't use a cached GC here since the function needs to modify the
	foreground color.

	* gdk/gdkwindow.c (gdk_window_end_paint): Reset clip region back
	to NULL on the cached GC.
2004-02-18 12:43:23 +00:00
Soeren Sandmann
1c51c48606 GC caching, bug #125645 (based on patch by Brian Cameron)
Wed Feb 18 01:44:59 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	GC caching, bug #125645 (based on patch by Brian Cameron)

	* gdk/gdkscreen.h (struct _GdkScreen): Add GC cache
	* gdk/gdkscreen.c (gdk_screen_dispose): New function. Unref the
	cached GC's here.
	* gdk/gdkdraw.c (_gdk_drawable_get_scratch_gc): New function to
	get a scratch gc.
	* gdk/gdkinternals.h: Declare the function here

	* gdk/gdkdraw.c (gdk_drawable_real_draw_pixbuf): Use
	_gdk_drawable_get_scratch_gc() instead of creating a new GC.
	* gdk/x11/gdkgeometry-x11.c (gdk_window_copy_area_scroll): same
	* gdk/x11/gdkdrawable-x11.c (draw_with_images): same
	* gdk/gdkwindow.c (gdk_window_get_composite_drawable): same
	* gdk/gdkwindow.c (gdk_window_end_paint): same
	* gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): same
	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_threshold_alpha): same
	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_pixmap_and_mask_for_colormap): same
2004-02-18 00:59:14 +00:00