Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-screenshooter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-screenshooter
Commits
d87faade
Commit
d87faade
authored
16 years ago
by
Jerome Guelfucci
Browse files
Options
Downloads
Patches
Plain Diff
Try to fix bug 4601.
(Old svn revision: 6074)
parent
000afcf0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+10
-0
10 additions, 0 deletions
ChangeLog
lib/screenshooter-utils.c
+18
-19
18 additions, 19 deletions
lib/screenshooter-utils.c
src/main.c
+8
-1
8 additions, 1 deletion
src/main.c
with
36 additions
and
20 deletions
ChangeLog
+
10
−
0
View file @
d87faade
2008-11-12 jeromeg
* lib/screenshooter-utils.c:
- (screenshooter_take_screenshot) rework the window grabbing to try to fix
bug 4601.
* src/main.c (main) try to fix 4601:
- hide the dialog instead of destroying it.
- sync the display before taking the screenshot.
- ugly, wait 1 second before taking the screenshot.
2008-11-09 jeromeg
2008-11-09 jeromeg
* Post release bump.
* Post release bump.
...
...
This diff is collapsed.
Click to expand it.
lib/screenshooter-utils.c
+
18
−
19
View file @
d87faade
...
@@ -130,9 +130,9 @@ GdkPixbuf *screenshooter_take_screenshot (gint mode,
...
@@ -130,9 +130,9 @@ GdkPixbuf *screenshooter_take_screenshot (gint mode,
gint
delay
)
gint
delay
)
{
{
GdkPixbuf
*
screenshot
;
GdkPixbuf
*
screenshot
;
GdkWindow
*
window
=
NULL
;
GdkWindow
*
window
,
*
window2
;
GdkScreen
*
screen
;
GdkScreen
*
screen
;
gint
width
;
gint
width
;
gint
height
;
gint
height
;
/* gdk_get_default_root_window (), needs_unref enables us to unref *window
/* gdk_get_default_root_window (), needs_unref enables us to unref *window
...
@@ -151,32 +151,31 @@ GdkPixbuf *screenshooter_take_screenshot (gint mode,
...
@@ -151,32 +151,31 @@ GdkPixbuf *screenshooter_take_screenshot (gint mode,
else
if
(
mode
==
ACTIVE_WINDOW
)
else
if
(
mode
==
ACTIVE_WINDOW
)
{
{
window
=
gdk_screen_get_active_window
(
screen
);
window
=
gdk_screen_get_active_window
(
screen
);
/* If we are supposed to take a screenshot of the active window, and if
/* If we are supposed to take a screenshot of the active window, and if
the active window is the desktop background, grab the whole screen.*/
the active window is the desktop background, grab the whole screen.*/
if
(
window
==
NULL
||
if
(
window
==
NULL
)
gdk_window_get_type_hint
(
window
)
==
GDK_WINDOW_TYPE_HINT_DESKTOP
)
{
{
if
(
!
(
window
==
NULL
))
{
g_object_unref
(
window
);
}
window
=
gdk_get_default_root_window
();
window
=
gdk_get_default_root_window
();
needs_unref
=
FALSE
;
needs_unref
=
FALSE
;
}
}
else
if
(
gdk_window_get_type_hint
(
window
)
==
GDK_WINDOW_TYPE_HINT_DESKTOP
)
{
{
GdkWindow
*
window2
;
window2
=
gdk_window_foreign_new
(
find_toplevel_window
(
GDK_WINDOW_XID
(
window
)));
g_object_unref
(
window
);
g_object_unref
(
window
);
window
=
window2
;
window
=
gdk_get_default_root_window
();
needs_unref
=
FALSE
;
}
}
else
{
window2
=
gdk_window_foreign_new
(
find_toplevel_window
(
GDK_WINDOW_XID
(
window
)));
g_object_unref
(
window
);
window
=
window2
;
}
}
}
/* wait for n=delay seconds */
/* wait for n=delay seconds */
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
8
−
1
View file @
d87faade
...
@@ -185,6 +185,7 @@ int main(int argc, char **argv)
...
@@ -185,6 +185,7 @@ int main(int argc, char **argv)
{
{
GtkWidget
*
dialog
;
GtkWidget
*
dialog
;
gint
response
;
gint
response
;
GdkDisplay
*
display
=
gdk_display_get_default
();
/* Read the preferences */
/* Read the preferences */
screenshooter_read_rc_file
(
rc_file
,
sd
,
FALSE
);
screenshooter_read_rc_file
(
rc_file
,
sd
,
FALSE
);
...
@@ -196,8 +197,12 @@ int main(int argc, char **argv)
...
@@ -196,8 +197,12 @@ int main(int argc, char **argv)
window mode */
window mode */
response
=
gtk_dialog_run
(
GTK_DIALOG
(
dialog
));
response
=
gtk_dialog_run
(
GTK_DIALOG
(
dialog
));
gtk_widget_
destroy
(
dialog
);
gtk_widget_
hide_all
(
dialog
);
gdk_display_sync
(
display
);
sleep
(
1
);
if
(
response
==
GTK_RESPONSE_OK
)
if
(
response
==
GTK_RESPONSE_OK
)
{
{
gchar
*
screenshot_path
=
NULL
;
gchar
*
screenshot_path
=
NULL
;
...
@@ -239,6 +244,8 @@ int main(int argc, char **argv)
...
@@ -239,6 +244,8 @@ int main(int argc, char **argv)
/* Save preferences */
/* Save preferences */
screenshooter_write_rc_file
(
rc_file
,
sd
);
screenshooter_write_rc_file
(
rc_file
,
sd
);
gtk_widget_destroy
(
dialog
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment