2006-06-11 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n
to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
Clipboard. (#344496)
2006-06-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
DeleteDC() on DCs acquired with CreateCompatibleDC() (for
bitmaps). According to MSDN, this is the correct thing to do, even
if always using DeleteDC() seems to have worked fine in
practice. (#337491)
2006-06-08 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
[WM_WINDOWPOSCHANGED] Replace identical code as in
handle_configure_event() with call to that function.
[WM_SIZING] Fix implementation of aspect ratio hints. (#344244)
The hints are for the geometry of the client area, not of the
window including decorations. Improve resizing behaviouor in the
presence of aspect hints, more in line with typical X window
managers.
2006-05-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (doesnt_want_scroll): Look at both
GDK_SCROLL_MASK and GDK_BUTTON_PRESS_MASK. (#139628)
Tue Apr 25 10:25:28 2006 Søren Sandmann <sandmann@redhat.com>
* tests/testgtk.c (create_alpha_window): Create 'composited' label.
* tests/testgtk.c (on_composited_changed): New function, change
the label to say whether the screen is composited or not.
* gtk/gtkwindow.c (gtk_window_on_composited_changed): When
composited status change, invalidate the window and propagate the signal;.
* gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint
if reset_type_hint is TRUE.
* gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of
the old hints, store a shadow copy in the public window->type_hint
bitfield, otherwise set this field to normal. Set the private
field to the type hint.
* gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint.
* gtk/gtkwindow.c (struct _GtkWindowPrivate): New field
"reset_type_hint" indicating whether the type hint needs to be
reset. New field type_hint containing a GdkWindowTypeHint.
* gtk/gtkwidget.c (propagate_composited_changed): New function to
propagate changes in composited status.
(gtk_widget_class_init): Add composited_changed signal.
* gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed.
* gtk/gtkwidget.c (gtk_widget_is_composited): New function.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for.
* gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether
the item belongs to a menubar. Set the type_hint appropriately
depending on the outcome.
* gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here.
* gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy
changed on the attach widget.
* gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to
set the transient_for property for menus.
* gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint.
* gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window
transient for the toplevel.
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set
transient-for, for the popup window.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for
new window types.
* gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support
for new window types.
* gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change):
New function called whenever the compositing manager comes and goes.
* gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function.
* gdk/x11/gdkscreen-x11.c
(_gdk_x11_screen_request_cm_notification, make_cm_atom,
check_is_composited): New functions
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
_gdk_x11_screen_process_owner_change when an
XFixesSelectionNotifyEvent is received.
* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call
_gdk_x11_screen_request_cm_notification() on all screens.
* gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy
implementation.
* gdk/gdkscreen.c (gdk_screen_class_init): New signal,
'composited-changed'.
* gdk/gdkwindow.h: Add new EWMH window types.
* gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-04-06 Tor Lillqvist <tml@novell.com>
Correct the appearance of non-square icons and cursors: pad them
to square so that Windows won't stretch them.
* gdk/win32/gdkcursor-win32.c (create_alpha_bitmap)
(create_color_bitmap): Always create square bitmaps, take only
side length as argument.
(pixbuf_to_hbitmaps_alpha_winxp, pixbuf_to_hbitmaps_normal):
Corresponding changes.
2006-03-29 Matthias Clasen <mclasen@redhat.com>
* gdk/gdk.symbols:
* gdk/gdkpixmap.h:
* gdk/win32/gdkpixmap-win32.c:
* gdk/x11/gdkpixmap-x11.c (gdk_pixmap_foreign_new_for_screen):
New function to allow wrapping a native pixmap without
a server roundtrip. (#334954, David Baron)
2006-03-11 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (draw_polygon): Use Polygon() for
outlined polygons, too. Same idea as in draw_rectangle(): Set pen
to NULL_PEN if drawing a filled polygon, set brush to HOLLOW_BRUSH
if drawing a polygon outline. (#332662)
(gdk_win32_draw_polygon): Corresponding simplification: no need to
add an extra final copy of the starting point.
2006-02-20 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (do_shape_combine_region): New
function. Factor out code from gdk_window_shape_combine_mask().
(gdk_window_shape_combine_region): Actually do something. Convert
region to a HRGN and call do_shape_combine_region().
(gdk_window_input_shape_combine_mask)
(gdk_window_input_shape_combine_region)
(gdk_window_set_child_input_shapes)
(gdk_window_merge_child_input_shapes): New functions, dummy
implementations.
2006-02-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate)
<WM_MOUSELEAVE>: If we don't know where we went, and have
generated a leave event, set current_window to the root
window. This assures we will generate proper enter and leave
events for popup windows. (#325521)
2006-02-08 John Ehresman <jpe@wingware.com>
* gdk/win32/gdkwindow-win32.c: Let gdk_window_set_decorations()
take precedence over anything derived from hints. Restructure
related code and logic, add some new helper functions. (#327217)
2006-02-08 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab)
(gdk_display_pointer_ungrab, gdk_keyboard_grab)
(gdk_display_keyboard_ungrab): Consistenly use assign_object()
when assigning GdkWindow pointers so that the ref counting doesn't
get off whack.
(handle_stuff_while_moving_or_resizing): Don't use deprecated API.
(gdk_event_translate) <WM_MOUSEMOVE>: When the pointer is grabbed
with owner_events FALSE, generate enter and leave events only for
the grab window. (#321054)
2006-01-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c
(gdk_window_impl_win32_get_visible_region): Make identical to the
X11 implementation. (#322264, John Ehresman)
2006-01-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkgeometry-win32.c (gdk_window_scroll): Get the
invalidated region from ScrollWindowEx() instead of an incorrect
attempt to calculate it ourselves. Fix by John Ehresman. (#323666)
* gdkevents-win32.c: Make _gdk_win32_hrgn_to_region() non-static.
* gdkprivate-win32.h: Declare it.
2005-11-28 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_set_urgency_hint):
Implement the conditional use of FlashWindowEx() properly for MSVC
compilations. The code was confusingly assuming that if compiled
with a "new" compiler, it will only be run on "new" Windows
versions. We want it to run on "old" versions, too, even if
compiled with a "new" compiler. There are two orthogonal issues:
whether the compiler defines the necessary API in its headers, and
whether it is present at run-time. (#318077)
2005-11-27 Tor Lillqvist <tml@novell.com>
Once again rework Win32 window decoration code. Doesn't break
#104514. The dialogs in gtk-demo now have the same decorations and
behaviour as on X11. Tried to fix#322516 but it seems very hard
to make the trivial sample program there behave as expected. OTOH,
simply moving the gtk_window_decorate() call in the #322516 sample
program after the call to gtk_widget_show() helps...
* gdk/win32/gdkwindow-win32.c (set_or_clear_style_bits): Revert to
the correct semantics. Each call to gdk_window_set_decorations()
which calls this function is supposed to affect all decorations.
(decorate_based_on_hints): New function, looks at both geometry
hints and type hint and sets window decorations based on
that. Consolidate code from gdk_window_set_geometry_hints() and
gdk_window_set_type_hint() here.
(gdk_window_set_geometry_hints, gdk_window_set_type_hint): Call
decorate_based_on_hints().
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/gdkinternals.h
* gdk/gdk.c (gdk_debug_keys[]): Add new GDK_DEBUG_DRAW flag to
the GdkDebugFlag enum.
* gdk/win32/gdkdrawable-win32.c: Use DRAW to trigger GDK_NOTEs in
this file instead of MISC. Now asking for MISC will give mainly
window manipulation debugging output.
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c: Remove unnecessary includes.
(_gdk_win32_get_adjusted_client_rect): Remove this two-line
function which was used only in one place.
(get_outer_rect): Use _gdk_win32_adjust_client_rect().
(gdk_window_set_geometry_hints): If we have identical minimum and
maximum size hints, remove the resize and maximize
decorations/functions. (#104514)
If we have a maximum size hint, remove the maximize
decoration/function but ensure the resize decoration/function is
available. Otherwise ensure both resize and maximize
decorations/functions are there.
(set_or_clear_style_bits): Factored out common code from
gdk_window_set_decorations() and gdk_window_set_functions().
Hack the window style setting once more: Only touch the window
style bits corresponding to the GdkWMDecoration or GdkWMFunction
parameter bitmasks. Hopefully this finally is the correct thing to
do. We used to clear all other bits than those that were being
set, or set all other bits than those that were being cleared.
Take into account that adding or removing decorations leaves the
window's outer size unchanged, i.e., the client area's size and
position change. This is apparently not what we want, so change
also the window's (outer) position and size appropriately so that
the client area's position and size stay constant.
gtk-demo's color selector dialog is now non-resizable like on X11
(I tested with metacity in GNOME). Torn off menus are shrinkable
vertically but have a maximum size, and are not maximizable or
minimizable, like on X11.
(gdk_window_set_decorations, gdk_window_set_functions): Let
set_or_clear_decorations() do most of the job.
* gdk/win32/gdkprivate-win32.h: Remove declaration of
_gdk_win32_get_adjusted_client_rect().
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32)
* gdk/win32/gdkwindow-win32.c (gdk_window_impl_win32_init,
gdk_window_get_type_hint, gdk_window_get_type_hint): Store the
type hint. Implement gdk_window_get_type_hint() by just returning
the hint stored.
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_set_geometry_hints):
Remove code that has been permanently ifdeffed out for two years.
2005-11-07 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_normal):
Correct the calculation of maskstride. (#320152, Peter Zelezny)
2005-11-06 Tor Lillqvist <tml@novell.com>
(pixbuf_to_hbitmaps_alpha_winxp): Use an 1-bit mask bitmap,
like pixbuf_to_hbitmaps_normal().
(_gdk_win32_pixbuf_to_hicon_supports_alpha): Check
G_WIN32_IS_NT_BASED() first, so we can pretend being on Win9x by
setting the G_WIN32_PRETEND_WIN9X environment variable.
2005-11-06 Tor Lillqvist <tml@novell.com>
Make icon masks work on Win98 (#320152, Peter Zelezny)
* gdk/win32/gdkcursor-win32.c (create_color_bitmap): Take also a
parameter for the depth of the bitmap, so that this function can
be used to create 1-bit bitmaps, too.
(pixbuf_to_hbitmaps_normal): Create an 1-bit bitmap for the mask,
and initialize it properly.
2005-11-03 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkcursor-win32.c: As there is only one GdkDisplay in
the Win32 backend, check that GdkDisplay* parameters are equal to
_gdk_display instead of using the unnecessarily general
GDK_IS_DISPLAY().
2005-11-03 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_alpha_winxp):
Rename the variables for the color bitmap to have "color" in their
name, for similarity with pixbuf_to_hbitmaps_normal(). Create a
color bitmap for the mask, too, instead of creating a b&w bitmap
with CreateBitmap(). Set up the mask bitmap's contents, ones for
those pixels in the color bitmap where the alpha is zero, zero for
other pixels. We used to use an unitialized mask bitmap! This
meant that icons and cursors created presumably worked more or
less by accident. Totally blank icons with zero alpha everywhere
(as used by gtktrayicon.c) definitely did not work as expected.
2005-11-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkcolor-win32.c
* gdk/win32/gdkscreen-win32.c
* gdk/win32/gdkwindow-win32.c: Whitespace consistency
fixes. Remove superfluous test for GdkWindow* parameters being
non-NULL. Testing GDK_IS_WINDOW() is enough. As there is only one
GdkScreen and one GdkDisplay in the Win32 backend, use those
variables instead of the getter functions. For GdkDisplay* and
GdkScreen* parameters, check that they are equal to the
corresponding singleton variables instead of the more general
GDK_IS_DISPLAY() or GDK_IS_SCREEN().
2005-11-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
pre-interned GdkAtoms and pre-registered clipboard formats. Sort
their declarations, definitions and assignments into a more
logical and consistent order.
* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
CF_ prefix for the predefined clipboard format names. Put quotes
around registered format names to distinguish them.
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
immediately with a warning if the property type is STRING, TEXT,
COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
should never pretend to handle on Win32. Handle only UTF8_STRING
here, other formats with delayed rendering. Use \uc1 instead of
\uc0 when generating Rich Text Format for easier testability on
XP, where WordPad misinterprets \uc0 encoded characters. Add more
GDK_NOTE debugging output for Clipboard operations.
* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
(gdk_selection_convert): Don't pretent to handle STRING, just
UTF8_STRING. Streamline error handling, don't unnecessarily have a
GError which then isn't used for anything anyway if it gets set.
(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-10-14 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdisplay-win32.c: Remove the clipboard viewer code.
It didn't really do anything useful, and was just confusing and
incomplete. Comments claimed we don't do delayed rendering, but in
fact we do, for images. (The delayed rendering code has other
problems, though, see #168173.) The clipboard viewer code was
probably even buggy (the WM_CHANGECBCHAIN handled didn't propagate
the message when necessary). It was just test code, it said so in
a comment. Add something similar back later if necessary.
(_win32_on_clipboard_change,
_gdk_win32_register_clipboard_notification): Remove.
(gdk_display_supports_selection_notification,
gdk_display_request_selection_notification): Always just return
FALSE. We didn't generate any GDK_OWNER_CHANGE events anywhere.
2005-10-13 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't treat
Alt-Enter specially. It does not have any special meaning and
should be passed on to the application. (#318378, Tim Evans)
2005-10-13 Tor Lillqvist <tml@novell.com>
Set visual depth to 24 for 32 bits-per-pixel devices on
Win32. This allows gdk_drawable_real_draw_pixbuf() to use the
optimized composite_0888() function rather than the slower image
dithering functions to draw pixbufs (#313993, John Ehresman)
* gdk/win32/gdkimage-win32.c (_gdk_win32_new_image): Use
_gdk_windowing_get_bits_for_depth() to initialize
GdkImage::bits_per_pixel.
(_gdk_windowing_get_bits_for_depth): Return 32 bits for depth 24.
* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new): Use
_gdk_windowing_get_bits_for_depth() to initialize
BITMAPINFOHEADER::biBitCount.
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Set
GdkVisual::depth to 24 even if GetDeviceCaps(BITSPIXEL) returns
32.
2005-10-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap): In case
BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
is that the the desktop isn't visible because the session has been
switched, the screen is locked, or a terminal server session
disconnected, so no error message necessary. (#137796)
It is of course remotely possible that BitBlt() failing with
ERROR_INVALID_HANDLE might also be caused by some other
problem. We could strive for perfection and track whether the
desktop is visible by using WTSRegisterSessionNotification() and
handling WM_WTSESSION_CHANGE. I think that's overdoing it just for
this issue, though. If we would track desktop visibility, we
should then avoid even trying to update the display at all while
the desktop isn't visible.
2005-09-26 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_shape_combine_mask): Set
the shaped flag here, too. (#316871)
(gdk_window_shape_combine_region): Currently unimplemented, so
don't do anything to the shaped flag here.
2005-09-21 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkselection-win32.c (gdk_selection_convert,
gdk_text_property_to_text_list_for_display,
gdk_text_property_to_utf8_list_for_display,
gdk_win32_selection_add_targets,
_gdk_win32_selection_convert_to_dib): Free return value from
gdk_atom_name().
(gdk_text_property_to_text_list_for_display): Drop GError variable
that isn't actually used after being set.
2005-09-20 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkselection-win32.c
(gdk_selection_owner_get_for_display): Do return the correct owner
for CLIPBOARD (i.e., the owner of the Windows Clipboard, if it is
a window GDK knows about). The reason to return NULL seems to have
gone when in the fix for bug #163702 the artificial
GDK_SELECTION_CLEAR event generation was removed from
gdk_selection_send_notify_for_display(). Fixes bug #316552.
2005-09-18 Hans Breuer <hans@breuer.org>
* gdk/gdk.symbols gdk/win32/gdkwin32.h gdk/win32/gdkcursorwin32.c : export
_gdk_win32_pixbuf_to_hicon() as gdk_win32_pixbuf_to_hicon_libgtk_only()
* gtk/gtktrayicon-win32.c : a lot of debug spew but it has started to show
the icon and is blinking with teststatusicon. More to come ...
2005-09-18 Hans Breuer <hans@breuer.org>
* gtk/makefile.msc.in : fix typo for GTK_VER; define HAVE_CONFIG_H
cause gtkprogressbar.c has #include <config.h> conditionally; less
noise from generated gtk.def
* gtk/stock-icons/makefile.msc gdk/makefile.msc tests/makefile.msc : updated
* gtk/gtktrayicon-win32.c : dummy implmentation to make gtk compile.
For me it works as well as the *NIX implemenation, that is not at all.
* gdk/win32/gdkproperty-win32.c : implement gdk_atom_intern_static_string()
* gdk/win32/gdkwindow-win32.c(gdk_window_set_urgency_hint) : only use
only use (WINVER >= 0x0500) when available from the SDK. Otherwise fall
back to true dynamic linking of FlashWindowEx. Makes gtk+ work on NT4.0
again - if compiled properly.
* tests/teststatusicon.c : don't use GNOME icons for testing, but icons
already coming with Gtk+. Makes it compile on win32.
2005-09-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdisplay-win32.c (gdk_display_get_name): Cache the
display name. There is only one GdkDisplay on Win32, and
constructing the display name isn't entirely trivial, so cacheing
is probably worth it. For instance GIMP calls this function a lot.
(gdk_display_open): Call gdk_display_get_name() to prime the
cached name.
(gdk_display_get_n_screens, gdk_display_get_screen,
gdk_display_get_default_screen): Verify parameter correctness like
the X11 backend does.
* gdk/win32/gdkscreen-win32.c (gdk_screen_make_display_name):
Return a freshly allocated string, as the API specifies. Fixes a
heap corruption problem that caused random errors and crashes in
GIMP, for instance.
2005-09-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of
cursor position also in root window coordinates. Prune out
superfluous WM_MOUSEMOVE messages even earlier, based on root window
coordinates. Windows sends WM_MOUSEMOVE messages after a new
window has ben mapped below the cursor even if the mouse doesn't
move. We used to generate GDK_MOTION_NOTIFY in these cases. This
confused at least gtk_menu_motion_notify(). (#314995)
* gtk/gtkintl.h: No need to include config.h here. It caused
warnings about GTK_LOCALEDIR being redefined on Win32 when
compiling files where gtkintl.h is included after gtkprivate.h
(which #undefines and re-#defines GTK_LOCALEDIR on Win32).
* gtk/gtkplug.c: Include config.h.